Apex › Storage & databases

Join algorithms

The same two tables joined three ways — nested-loop, hash, and sort-merge. Edit the keys and watch the work each does: the nested-loop grid literally is its |R|·|S| comparisons, hash join builds a table on S, sort-merge sorts both for a single linear sweep. All three return identical rows; the optimizer picks by cost.

More in Storage & databases