GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 70

Secondary multilevel index blocks

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2008 paper

GATE 2008, Q70 2 marks · MCQ
Report issue

Indexing, Storage & Query Processing

Question 70, GATE 2008: A file has 16384 records of 32 bytes each, with a 6-byte key. It is ordered on a non-key field and uses unspanned organization. Block size is 1024 bytes and block pointers occupy 10 bytes. A multilevel secondary index is built on the key. How many first- and second-level index blocks are needed?

(A) 8 and 0
(B) 128 and 6
(C) 256 and 4
(D) 512 and 5
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Because the file is not ordered by the indexed key, the first secondary-index level is dense, with one entry per record. An entry occupies 6+10=16 bytes, so a 1024-byte block holds 64 entries.
2. The first level therefore needs 16384/64=256 blocks. The second level indexes those ordered first-level blocks, requiring 256/64=4 blocks.
3. Option C. The 512 data blocks are not the first-level index-block count.

Original paper, page 14