StreakPeaked· Practice

ExamsGATETechnical

Consider a file of 16384 records. Each record is 32 bytes long and its key field is of size 6 bytes. The file is ordered on a non-key field, and the file organization is unspanned. The file is stored in a file system with block size 1024 bytes, and the size of a block pointer is 10 bytes. If a secondary index is built on the key field of the file, and a multi-level index scheme is used to store the secondary index, the number of first-level and second-level blocks in the multi-level index are respectively

  1. 8 and 0
  2. 128 and 6
  3. 256 and 4
  4. 512 and 5

Correct answer: 256 and 4

Solution

A secondary index on a key is dense: 16384 entries, each key(6)+pointer(10)=16 bytes, so blocking factor = 1024/16 = 64. First level = ceil(16384/64)=256 blocks; second level = ceil(256/64)=4 blocks. The answer is 256 and 4.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →