CS FundamentalsModerateGATE CS (PYQ pattern)

A table has 1,000,000 rows in 10,000 pages. An unclustered B+ tree index of height 3 costs 3 page reads to reach the first matching entry plus one page read per matching row (leaf scanning ignored); a full scan costs 10,000 reads. Up to what selectivity (fraction of rows matched) is the index plan cheaper, approximately?

  1. A. about 10%
  2. B. about 0.1%
  3. C. about 1%
  4. D. about 100%

Correct answer: C. about 1%

Index cost = 3 + s x 1,000,000 < 10,000 gives s < 0.9997% (about 1%). An unclustered index loses quickly because each match can cost a separate page; 10% would be right only if rows-per-page were ignored (comparing with 100,000).

More DBMS and SQL questions

Exams that ask this topic