Hash Join
A hash join builds a hash table from the small table and scans the large table probing it for matches, ideal for unordered equi-joins of large tables.
Purpose
To understand the efficient algorithm for equi-joins and its applicable scenarios (large unordered joins).
Mechanism
Build phase: hash the inner (small) table on the join key. Probe phase: scan the outer (large) table, probing the hash table per row. When memory is insufficient, partition to disk (grace hash join).
Use cases
- Join algorithm selection
- Large table join optimization
- Execution plan analysis