First page Back Continue Last page Graphics
…Sort-Merge Join
Useful for non-equijoins
Also useful if sort step can be skipped
- If index full scan can return data sorted by join key
Notes:
The sort-merge join can be useful for range joins (e.g. > or <) because hash joins are not available for non-equijoin operations.
Once in a while CBO will choose a sort-merge join over a hash join if an index is available on the join key that can be used to skip the sort step. In this case, CBO determines that the expense of hashing the table would outweigh the cost of the sort-merge join.