The Gateway to Computer Science Excellence
+1 vote
suppose that in a file organization record size(R)=150 bytes , block size (B)=512 bytes. there are totally 30000 records. the data field on which indexing is done is 9 bytes and block pointer size is 7 bytes how many block access will be needed to access a data item in case of single level primary indexing?
in CO and Architecture by Active (3.2k points)
edited by | 95 views
is it 10?
The answer should be 10.
yes I too got 10 but in the answer key they have given 9 , just wanted to confirm.

Thanks :)

The answer will be 9 when we have access the Block only. If you want to access the data of that particular Block then the answer will be 10.

==> Here asking for the Data items. So, the answer will be 10.

2 Answers

+3 votes
Best answer

10 is right .

by Boss (36.5k points)
selected by
thanks...concept got clear
+1 vote
No. of blocks in disk = (30000x150)/512 = 8789.

In primary indexing , one entry for each block is there , so number of blocks in index = (8789 x 16)/512 = 274.65 = 275.

Now , we can apply binary search for primary indexing .

ceil(log(275)) = 9

In worst case , it'll take 9 block transfers to locate the exact block and 1 extra transfer for getting that block.

Therefore total number of transfers = 10.
by Loyal (5.8k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,321 answers
105,141 users