First page Back Continue Last page Graphics
Sort-Merge Join…
Usually, tables are sorted before join of rows
Sort delays return of 1st row
No driving table
Notes:
When the hash-join method is not available (perhaps the join is not an equi-join), a sort-merge join can sometimes be best for overall throughput when processing large sets. Note that usually the hash join performs better than the sort merge, but is not always an available path (perhaps the join is a range join).
Sort merge joins can – if no index exists on the join key – require significant pre-processing of the data (sorting). Therefore, the invoker will not start receiving rows until the preprocessing has completed which can require a long time. Because of this, the sort-merge join is usually not good in an on-line environment. It is much better suited in a batch environment.
There is not a driving table in the sort merge join; both tables are sorted and the results are merged together.