CS FundamentalsHardGATE CS (PYQ pattern)

A table of 1,000,000 rows (100 rows per page, 10,000 pages) is clustered on A, with a B+ tree whose leaves hold 200 entries each; reaching the first matching leaf costs 2 internal-node reads plus that leaf. A range predicate selects 1% of the rows. If the scan reads the qualifying leaf pages and then the qualifying data pages, how many page reads are needed?

  1. A. 102
  2. B. 152
  3. C. 10052
  4. D. 103

Correct answer: B. 152

1% = 10,000 rows. Leaves: 10,000 / 200 = 50 pages (the first included), data: 10,000 / 100 = 100 consecutive pages. Total 2 + 50 + 100 = 152. Ignoring the leaves gives 102; reading one page per row (unclustered) gives about 10,052.

More DBMS and SQL questions

Exams that ask this topic