CS FundamentalsEasyGATE CS (PYQ pattern)

Block nested-loop join of R (800 pages) and S (300 pages) with 52 buffer pages (1 for the inner input, 1 for output, 50 for the outer block). Ignoring the cost of writing the result, what is the minimum number of page reads over the two choices of outer relation?

  1. A. 5600
  2. B. 1100
  3. C. 4800
  4. D. 5100

Correct answer: D. 5100

R outer: 800 + ceil(800/50) x 300 = 5600. S outer: 300 + ceil(300/50) x 800 = 5100. The smaller relation as outer is better: 5100.

More DBMS and SQL questions

Exams that ask this topic