CS FundamentalsModerateGATE CS (PYQ pattern)

A secondary dense index on a non-key attribute of a file with 1,000,000 records uses 4096-byte pages, 12-byte key + 8-byte pointer entries and a multilevel index (each higher level is a sparse index on the level below). How many levels does the index need until the top level fits in one page?

  1. A. 2
  2. B. 3
  3. C. 4
  4. D. 5

Correct answer: B. 3

Entries per page = floor(4096 / 20) = 204. Level 1: ceil(1,000,000 / 204) = 4902 pages; level 2: ceil(4902 / 204) = 25 pages; level 3: 1 page. So 3 levels.

More DBMS and SQL questions

Exams that ask this topic