The GATE Grind

GATE 2021 CS (CS2) – Question 31

Databases · File Organization and Indexing (B and B+ Trees) · 1 mark · Numerical answer

A sorted data file has 150000 student records and 4096-byte blocks. Disk record pointers are 7 bytes; candidate-key Anum is 12 bytes. A dense index stores Anum and its record pointer in each index record, on the same disk. Records cannot straddle blocks. Find the number of index blocks.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 698 to 698

Explanation

Each dense index record uses 12+7=19 bytes. A block holds floor(4096/19)=215 complete index records. One entry is needed per student, so the block count is ceil(150000/215)=698. The sort order on another key does not make the candidate-key index sparse.

More File Organization and Indexing (B and B+ Trees) questions

All File Organization and Indexing (B and B+ Trees) questions →