edited by
1,968 views
2 votes
2 votes
Suppose size of disk block 1000 Bytes and search key of 12 Bytes, pointer size 8 bytes. How many minimum number of records in data file which leads 3 level dense B+ tree index? (Assume minimum node fill factor ceil(P/2) pointers where p is the maximum pointer per node).
edited by

1 Answer

1 votes
1 votes
Minimum records in the file will be same as minimum number of <key,pointer> pairs in all leaf nodes.

First find the best order for the leaf: $(p-1)*(12+8) + 8 \leq 1000$ $\rightarrow$ $p-1 \leq \frac{992}{20} $ $\rightarrow$ $p=50$

This means maximum 50 pointers(record and block) and minimum 25 pointers $\rightarrow$ min 24 <keys,pointer> pairs

.Here each pair corresponds to a record in file.

Best order for internal node : $p(8) + (p-1)12 \leq 1000$ $\rightarrow$ $p = 50$ $\rightarrow$ min 25 ptrs and min 24 keys.

So, At Level 1, For Root, "minimum 2 pointers" $\rightarrow$ 2 internal nodes at Level 2.

Total pointers at Level 2 considering minimum $\rightarrow$ 25 pointers per node * 2 nodes = 50 pointers $\rightarrow$ Total leaves at the last Level 3 $\rightarrow = 50$

So total <key,pointer> pairs = 24 pointers per leaf * 50 leaves $\rightarrow$ 1200 pairs.

This means $1200$ minimum records will be needed to make a $B^{+}$ Tree of 3 levels.
edited by

Related questions

1 votes
1 votes
0 answers
4
raviyogi asked Jan 4, 2018
295 views
how many block at database level (storing records) are required?