retagged by
908 views
8 votes
8 votes
Assume that a data file contains $2000$ records that are ordered by a key attribute $K$ , and a primary index on attribute $K$ is built.

The size of key is $5B$ and block pointer is $5B$. Each block of the system is of size $105B$, out of which $100B$ can be used to store data (and $5B$ is reserved for storing meta data).

The total number of disk accesses required to fetch the record using the index (in average case) is  _____.
retagged by

3 Answers

Best answer
8 votes
8 votes

No. of records given = 2000

Meta data size(Size of each record) = 5 B

Total data record size= 2000*5

Block size(given) = 100 B

No. of data blocks required = (2000*5) / 100 = 100

Index record = 10 B     (Size of key = 5+ Block pointer = 5)

Index record per block = 100/10 = 10

No. of blocks required to put index files: 100/10=10

Block access = log 10 + 1 = 4+1 = 5 ANSWER

selected by
3 votes
3 votes

Idk why meta data is being considered as the record size. I highly doubt if that's correct.


Records = 2000.

Block size = 100B

Size of an index record = 10B

 

1st level index $= 2000/10 = 200$ $blocks.$

2nd level index $= 200/10 = 20$ $blocks.$

3rd level index $= 20/10 = 2$ $blocks.$

4th level index $= 2/10 = 0.2$ $blocks = 1$ $block$.

 

Hence, we need 4 levels of indexing.

 

Number of accesses would be $4+1=5$

Answer:

Related questions

1 votes
1 votes
1 answer
1
Bikram asked Aug 26, 2017
399 views
Assume that a B-Tree is used as an index for a large database table which has six levels (including the root node). If a new key is inserted into this index, then the max...
2 votes
2 votes
1 answer
2
Bikram asked Aug 26, 2017
431 views
The above ER diagram depicts a book rental scheme.If this ER diagram is mapped to a relational model, to correctly depict this above scenario, the total number of relatio...
3 votes
3 votes
2 answers
3
Bikram asked Aug 26, 2017
409 views
$\sigma_{A=B \text{ and } B=C \text{ and } C=A} \bigg( \Pi_A (R) \times \Pi_B (R) \times \Pi_C (R) \bigg)$The number of rows returned by the above relational algebraic ex...
9 votes
9 votes
1 answer
4