GATE / CS ARCHIVE

GATE CSE 1993 / QUESTION 14

ISAM data and multilevel index sizing

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

GATE 1993, Q14 5 marks · Descriptive
Report issue

Indexing, Storage & Query Processing

Question 14, GATE 1993: An ISAM file has 16K records of 64 bytes including a 14-byte key. A block address needs 2 bytes; disk blocks are 512 bytes. Find data blocks, index blocks, and number of index-tree levels.
Tap to enlarge
Answer & solution

Answer: 2048 data blocks; 67 index blocks (64+2+1); 3 index levels, or 4 levels including data. (no official key was published)

Use K=1024, full blocks, unspanned fixed-length records, and the usual sparse ISAM index with one key-and-block-address entry per child block. Each data block holds floor(512/64)=8 records. Thus 16*1024/8=2048 data blocks are needed. The 14-byte key is already included in each 64-byte record; it must not be added again.

An index entry occupies 14+2=16 bytes, so an index block contains floor(512/16)=32 entries and can identify 32 child blocks. The lowest index level needs one entry for each of 2048 data blocks, giving ceil(2048/32)=64 index blocks. The next level indexes those 64 blocks and uses ceil(64/32)=2 blocks. A root indexes these two and fits in ceil(2/32)=1 block. Hence the total index area contains 64+2+1=67 blocks.

The hierarchy is:
root index: 1 block (2 populated entries)
    -> middle index: 2 blocks (64 entries in total)
        -> bottom index: 64 blocks (2048 entries in total)
            -> data: 2048 blocks (16384 records).

There are three index levels, excluding the data level. If all levels including data are counted, the root-to-record path spans four levels; that is a different counting convention. The data area occupies 2048*512=1,048,576 bytes, and the allocated index area occupies 67*512=34,304 bytes, including root slack. There are 2115 blocks overall. No overflow reserve, block header overhead, or occupancy factor is supplied, so none is invented. A dense record-level index would have a different size and is not the standard sparse ISAM interpretation used here.

Original paper, page 11