2-pass
hash based
algorithm for equi-join
(R ⋈ S)
-
pass 1
Organization:
use 1 buffer to
read R (or S) and
(M−1) buffer to
write Ri (or Si)
Property of the tuples in a hash bucket
Same attribute value
in R
and S will be
hashed into the same bucket:
2-pass
hash based
algorithm for equi-join
(R ⋈ S)
-
pass 2
Pass 2:
process
each pair of
sub-relation Ri and Si
using the one-pass
⋈ algorithm:
Performance cost
Buffer requirement -
key observation
Buffer requirement -
estimate size
Assumed size of
each sub-relation:
Minimum
buffer requirement:
(derive using the fact that
min(B(Ri,B(Si)
≤ M−1)
❮
❯