CS FundamentalsModerateGATE CS (PYQ pattern)

R has 100 pages and S has 50 pages. Block nested-loop join uses 12 buffer pages: 10 for a block of the outer relation, 1 for the inner and 1 for output (result not written). What is the minimum I/O cost over the two choices of outer relation?

  1. A. 600
  2. B. 5100
  3. C. 150
  4. D. 550

Correct answer: D. 550

R outer: 100 + ceil(100/10) x 50 = 600. S outer: 50 + ceil(50/10) x 100 = 550. The smaller relation as outer is cheaper here. 5100 is page-at-a-time nested loops; 150 would need S to fit entirely in memory.

More DBMS and SQL questions

Exams that ask this topic