CS FundamentalsHardProduct-company placement · GATE CS

A table has 1,000,000 rows stored 20 per block. An unclustered B+ tree index fetches each matching row with one random block read (ignore index traversal). Above roughly what selectivity is a full table scan cheaper than using the index?

  1. A. 20%
  2. B. 2%
  3. C. 50%
  4. D. 5%

Correct answer: D. 5%

The scan reads 1,000,000 / 20 = 50,000 blocks; the index costs about one read per matching row, so it loses once matches exceed 50,000 rows, i.e. 5% = 1 / (rows per block). Optimisers therefore skip unclustered indexes for even moderately selective predicates.

More DBMS and SQL questions

Exams that ask this topic