921 views
1 votes
1 votes
Assume that a data file contains 1000 records that are ordered by a key
attribute A, and a primary index on attribute A is built. Let the size of
key be 5B and block pointer be 5B. Each block of the system is of 105B,
out of which 100B can be used to store data and 5B is reserved for storing
meta data. How many disk accesses will be required to fetch the record using the
index in average case?

 a. 6

 b. 3

 c. 4

 d. 5

1 Answer

Best answer
2 votes
2 votes
a block of file store 100/5=20 record

so no of block required to store file=1000/20=50 block

so we create primary index on 50 block means primary index contain 50 entry

size of one entry of primary index=5B (for key)+5B (for block pointer)=10B

one block can store 100/10=10 entry of index

no of block req to store index=50/10=5

searching an entry in index use binary serarch require log(5) block access>2 means 3 at worst case

+1 for finding key in data file

so total 4 block access required
selected by
Answer:

Related questions

1 votes
1 votes
0 answers
4
gulsanchouhan asked Sep 28, 2017
334 views
Which of the following can be described as a programming model used to develop applications processing massive amounts of data in a distributed and/or parallel manner?1. ...