CS FundamentalsVery hardGATE CS · DBMS

A file has 50,000 records of 200 bytes stored unspanned in 2048-byte blocks, NOT ordered on attribute X. A dense secondary index on X (a candidate key) has one entry per record: a 12-byte key and a 8-byte record pointer. Searching by binary search on the index plus one data-block read needs how many block accesses in the worst case?

  1. A. 9
  2. B. 7
  3. C. 10
  4. D. 2500

Correct answer: C. 10

Dense index: 50,000 entries, ⌊2048/20⌋ = 102 per block, so 491 index blocks; ⌈log₂ 491⌉ = 9, +1 data block = 10. (A linear scan of the file would average about 2,500 blocks.)

More DBMS and SQL questions

Exams that ask this topic