Hash-Join
•Partition both relations using hash fn h:  R tuples in partition i will only match S tuples in partition i.
vRead in a partition of R, hash it using h2 (<> h!). Scan matching partition of S, search for matches.
Partitions
of R & S
Input buffer
for Si
Hash table for partition
Ri (k < B-1 pages)
B main memory buffers
Disk
Output
 buffer
Disk
Join Result
hash
fn
h2
h2
B main memory buffers
Disk
Disk
Original
Relation
OUTPUT
2
INPUT
1
hash
function
h
B-1
Partitions
1
2
B-1
. . .