Slideshow:
Relevant statistics:
|
|
|
|
|
Different because materialization !!!
Hash R: B(R) [read] + B(R) [write]
Hash S: B(S) [read] + B(S) [write]
1 pass join on each Ri ⋈ Si: B(R) [read] + B(S) [read]
Materialize Ri ⋈ Si on disk: B(R⋈S) [write blocks]
-----------------------------------------------------------------
Total # disk IOs: 3 B(R) + 3 B(S) + B(R⋈S)
= 3 × 5000 + 3 × 10000 + B(R⋈S)
= 45000 + B(R⋈S) blocks
|
(Computing the memory buffer requirement is in fact easier if you materialize... You just "start over" again)
|
Hash R ⋈ S: B(R⋈S) [read] + B(R⋈S) [write] Hash T: B(T) [read] + B(T) [write] 1 pass join on each Xi ⋈ Ti: B(R⋈S) [read] + B(T) [read] ----------------------------------------------------------------- Total # disk IOs: 3 × B(R⋈S) + 3 B(T) = 3 × B(R⋈S) + 3 × 10000 = 3 × B(R⋈S) + 30000 blocks |
# disk IOs for ⋈1 = 45000 + k # disk IOs for ⋈2 = 3×k + 30000 ------------------------------------------------------- Total # disk IOs = 4×k + 75000 |
Compare to pipeline using 3-pass join:
Total # disk IOs = 4×k + 95000 |
|