CS FundamentalsVery hardGATE CS · Product placement

A file has 20,000 records of 80 bytes stored unspanned in 512-byte blocks, NOT ordered on attribute X. A dense secondary index on X (a candidate key) has one entry per record: a 10-byte key and a 6-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. 11
  2. B. 8
  3. C. 1667
  4. D. 10

Correct answer: A. 11

Dense index: 20,000 entries, ⌊512/16⌋ = 32 per block, so 625 index blocks; ⌈log₂ 625⌉ = 10, +1 data block = 11. (A linear scan of the file would average about 1,667 blocks.)

More DBMS and SQL questions

Exams that ask this topic