GATE Exam  >  GATE Questions  >  Consider an ordered file with 1,00,000 record... Start Learning for Free
Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.
  • a)
    5
  • b)
    3
  • c)
    8
  • d)
    2
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Consider an ordered file with 1,00,000 records stored on a disk using ...
Number of records per block = 2048/256 =8
Size of each index entry = 10+6 = 16.
number of entries per block =2048/16 = 128
Total number of indexes = total number of blocks in file = 100000/8 =12500
So, number of index blocks = ceil(12500/128) = 98
Total number of block access = 1+ceil(log298) =1+7 = 8.
View all questions of this test
Most Upvoted Answer
Consider an ordered file with 1,00,000 records stored on a disk using ...
Given Information:
- Ordered file with 1,00,000 records
- Un-spanned file organization
- Block size = 2048 bytes
- Record length = 256 bytes
- Primary indexing over a field of size 10 bytes
- Block pointer size = 6 bytes

To find: Number of block accesses required to search for a record.

Solution:
1. Calculation of records per block:
- Block size = 2048 bytes
- Record length = 256 bytes
- Therefore, records per block = 2048/256 = 8 records

2. Calculation of number of data blocks:
- Total records = 1,00,000
- Records per block = 8
- Therefore, number of data blocks = 1,00,000/8 = 12,500 blocks

3. Calculation of index entries per block:
- Block size = 2048 bytes
- Block pointer size = 6 bytes
- Size of index entry = 10 + 6 = 16 bytes
- Therefore, index entries per block = 2048/16 = 128 entries

4. Calculation of number of index blocks:
- Total index entries = 1,00,000
- Index entries per block = 128
- Therefore, number of index blocks = 1,00,000/128 = 781.25 blocks
- Since we cannot have fractional blocks, we round it up to 782 blocks

5. Calculation of total number of blocks:
- Number of data blocks = 12,500
- Number of index blocks = 782
- Therefore, total number of blocks = 13,282 blocks

6. Calculation of number of index blocks to search for a record:
- Since primary indexing is used, we need to search for the record in the index first
- Size of index entry = 16 bytes
- Therefore, number of index entries in a block = 2048/16 = 128 entries
- Size of data block pointer = 6 bytes
- Therefore, number of data block pointers in a block = 2048/6 = 341 pointers
- To search for a record, we need to search for the appropriate index block first, and then search for the data block using the data block pointer in the index block
- To search for an index block, we need to search through the index blocks sequentially, which requires 782/2 = 391 block accesses on average
- Once we find the appropriate index block, we need to search for the data block using the data block pointer in the index block, which requires 1 block access
- Therefore, total number of block accesses required to search for a record = 391 + 1 = 392 block accesses

Therefore, the correct option is (c) 8.
Explore Courses for GATE exam

Similar GATE Doubts

Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer?
Question Description
Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. 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 an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. 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 an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer?.
Solutions for Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. 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 an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider an ordered file with 1,00,000 records stored on a disk using un-spanned file organization. Block size is 2048 bytes and record length 256 bytes. If primary indexing is used over a field of size 10 bytes and block pointer size is 6 bytes. Then a number of block access is required to search for a record.a)5b)3c)8d)2Correct answer is option 'C'. 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