Query Processing and Optimization
Query Processing and Optimization
Query Processing and Optimization
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Hash Join Cost<br />
• Cost Total = Cost Partitioning + Cost Joining<br />
= 3 × (b r + b s ) + 2 × n h<br />
• Cost = 3 × (2000 + 10) + 2 × 5 = 6040<br />
• Any problem not considered?<br />
• What if n h > n B -1? I.e., more partitions than available buffer blocks!<br />
• How to solve it?<br />
OUTPUT<br />
1<br />
Relation<br />
r or s<br />
INPUT<br />
hash<br />
function<br />
. . .<br />
n B<br />
h<br />
2<br />
n B -1<br />
Disk<br />
n B main memory buffers<br />
23