Consider a file of records. Each record is long and its key field is of size . 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 , and the size of a block pointer is . If the 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
View worked solution
Answer: C
To find the number of blocks at each level of the multi-level secondary index, we proceed as follows:
- Identify the Index Type: Since a secondary index is built on a key field (which is not the ordering field of the file), it must be a dense index. This means there is one index entry for every record in the data file.
Number of records =
Number of first-level index entries = - Calculate Index Entry Size ():
- Calculate Index Blocking Factor ():
- Number of First-Level Blocks ():
- Number of Second-Level Blocks ():
The second level of a multi-level index is a sparse index containing one entry for each block of the first level.
Number of second-level index entries =
Thus, the number of first-level and second-level blocks are 256 and 4 respectively.
Free practice · Your answers on this page are not saved.
