CS FundamentalsHardGATE CS

R occupies 1000 blocks and S 500 blocks; 50 buffer blocks are available. Ignoring the cost of writing the result, what does a Grace hash join of R and S cost in block I/Os?

  1. A. 4500
  2. B. 1500
  3. C. 7500
  4. D. 3000

Correct answer: A. 4500

Partitioning reads and writes both relations (2 × 1500) and the probe phase reads them once more (1500): 3(M + N) = 4500. 50 buffers are enough since each S partition must fit in memory (about √500 ≈ 23). 7500 is a sort-merge join with one merge pass per relation.

More DBMS and SQL questions

Exams that ask this topic