CS FundamentalsVery hardGATE CS (PYQ pattern)

R occupies 1000 pages with 100 tuples per page. S has a B+ tree index on the join attribute (3 levels, so 3 page reads to reach a leaf entry, plus 1 read for the matching S tuple). Each R tuple matches exactly one S tuple. With R as the outer relation (scanned once) and enough buffer to hold nothing else useful, how many page reads does index nested-loops join need?

  1. A. 4,000
  2. B. 301,000
  3. C. 400,000
  4. D. 401,000

Correct answer: D. 401,000

Scan R once: 1000 reads. Then each of the 1000 x 100 = 100,000 R tuples probes the index: 3 + 1 = 4 reads. Total = 1000 + 400,000 = 401,000.

More DBMS and SQL questions

Exams that ask this topic