View worked solution
Answer: 698 : 698
To find the number of blocks required for the index file, we need to determine the type of index, the size of each index record, and the number of index records that can fit in a single block.
1. Determine the Type of Index
- The data file is sorted on the primary key .
- The index is built on , which is a candidate key (non-ordering key).
- An index on a non-ordering key is a Secondary Index. Since it is a secondary index, it must be a dense index (i.e., there is one index entry for every record in the data file).
- Therefore, the total number of index records () = .
2. Calculate the Index Record Size
Each index record consists of the candidate key and a record pointer:
3. Calculate the Blocking Factor of the Index File
Since the records cannot be split across disk blocks (unspanned organization), the number of index records per block () is:
4. Calculate the Number of Blocks for the Index File
The total number of blocks required is:
Thus, the number of blocks in the index file is 698.
Free practice · Your answers on this page are not saved.
