Software-Engineering
August 26, 2024Software-Engineering
August 26, 2024Indexing
Question 4 |
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 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
8 and 0 | |
128 and 6 | |
256 and 4 | |
512 and 5 |
Question 4 Explanation:
Total no. of records in a file = 16384
Record size = 32 bytes
Key size = 6 bytes
Block pointer size = 10 bytes
Block size of file system = 1024 bytes
Record (or) index entry size = 10+6 = 16 bytes
In first level no. of blocks = No. of records in a file/Block size =16384 * 16/1024 = 256
In second level, it have = 256*16 entries
In second level, no. of blocks = No. of entries/Block size = 256*16/1024 = 4
Record size = 32 bytes
Key size = 6 bytes
Block pointer size = 10 bytes
Block size of file system = 1024 bytes
Record (or) index entry size = 10+6 = 16 bytes
In first level no. of blocks = No. of records in a file/Block size =16384 * 16/1024 = 256
In second level, it have = 256*16 entries
In second level, no. of blocks = No. of entries/Block size = 256*16/1024 = 4
Correct Answer: C
Question 4 Explanation:
Total no. of records in a file = 16384
Record size = 32 bytes
Key size = 6 bytes
Block pointer size = 10 bytes
Block size of file system = 1024 bytes
Record (or) index entry size = 10+6 = 16 bytes
In first level no. of blocks = No. of records in a file/Block size =16384 * 16/1024 = 256
In second level, it have = 256*16 entries
In second level, no. of blocks = No. of entries/Block size = 256*16/1024 = 4
Record size = 32 bytes
Key size = 6 bytes
Block pointer size = 10 bytes
Block size of file system = 1024 bytes
Record (or) index entry size = 10+6 = 16 bytes
In first level no. of blocks = No. of records in a file/Block size =16384 * 16/1024 = 256
In second level, it have = 256*16 entries
In second level, no. of blocks = No. of entries/Block size = 256*16/1024 = 4