GATE Exam  >  GATE Questions  >  Consider a file of 8192 records. Each record ... Start Learning for Free
Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-
  • a)
    2
  • b)
    1
  • c)
    3
  • d)
    4
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider a file of 8192 records. Each record is 4bytes long and its ke...
DB size 512
record size 16
no of record possible in disk block 512/16 = 32 records/block
no of Disk block present in DB file 8192/32 = 256
So a primary index is used which is called a sparse index. In this index we make entries of each disk block but not of every record.!
so at first level we have = 256/(index file size )
now wt is index file : with the help of block pointer and search we locate records so index file size = 512/(6+10) = 512/16 = 32 (records per index )
so at first level we have 256/32 = 8 index blocks
and hence multilevel index is used so on the second level we have only 1 index block.
View all questions of this test
Most Upvoted Answer
Consider a file of 8192 records. Each record is 4bytes long and its ke...
Given:
- File contains 8192 records
- Record size is 4 bytes
- Key field size is 6 bytes
- File is ordered on key field
- File organization is unspanned
- Block size is 512 bytes
- Size of block pointer is 10 bytes

To find:
- Number of second level blocks in the multilevel index

Solution:
1. Calculate the number of records that can fit in one block:
- Block size = 512 bytes
- Record size = 4 bytes
- Number of records per block = 512/4 = 128 records

2. Calculate the number of records that can fit in one index block:
- Index block size = Block size - Size of block pointer = 512 - 10 = 502 bytes
- Size of one index entry = Key field size + Size of block pointer = 6 + 10 = 16 bytes
- Number of index entries per block = 502/16 = 31 entries

3. Calculate the number of blocks required to store the file:
- Number of records = 8192
- Records per block = 128
- Number of data blocks = 8192/128 = 64 blocks

4. Calculate the number of entries required to store the primary index:
- Number of records = 8192
- Entries per block = 31
- Number of index blocks = 8192/31 = 264 blocks

5. Calculate the number of blocks required for the second level index:
- Entries per block = 31
- Number of index blocks = 264
- Maximum entries per block = Block size/Index entry size = 512/10 = 51 entries
- Number of blocks required for second level index = ceil(264/51) = 6 blocks

6. Since the question asks for the number of second level blocks, the answer is 1 (the root block of the second level index).

Therefore, the number of second level blocks in the multilevel index is option B (1).
Explore Courses for GATE exam

Similar GATE Doubts

Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer?
Question Description
Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer?.
Solutions for Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a file of 8192 records. Each record is 4bytes long and its key field is of size 6 bytes. The file is ordered on a key field, and the file organization is unspanned. The file is stored in a file system with block size is 512 bytes, and the size of a block pointer is 10bytes. If the primary index is built on the key field of the file, and a multilevel index scheme is used to store the primary index, the number of second level blocks in the multilevel index are-a)2b)1c)3d)4Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev