in Databases edited by
1,136 views
2 votes
2 votes
In a database file structure, the search key field is 9 bytes long, the block size is 1024 bytes, a record pointer is 7 bytes and a block pointer is 6 bytes. The largest possible order of a leaf node in a B+ tree implementing this file structure is ________.

I am getting 63 as the answer, but in the solution, it's saying 64. Can anyone check?
in Databases edited by
1.1k views

4 Comments

63 is right ans
0
0

here it is given that we need to find the order for B+ tree leaf node

so for that we need to know the structure of B+ tree leaf node

in B+ tree leaf node, it consists of (key+record pointer) pair and a single block pointer which points to its adjacent node.

hence the formula

0
0

Order for a node is the maximum number of pointers that the node contains.

Here, in a B+ tree, leaf node has say p pairs of key and data pointers and one block pointer.

p(key + data pointer) + block pointer <= block size

p(9+7) + 6 <= 1024

p<=1018/16=63.xyz

Thus p=63...........Hence Order of leaf node= Number of Pointers( Data + Block)= 63 +1= 64

@srestha  @souravsaha  @mohitbawankar...... I think the answer 64 is correct.

Kindly correct if I am wrong.

0
0

2 Answers

0 votes
0 votes
 

Disk Block size = 1024 bytes
  
Data Record Pointer size, r = 7 bytes
Value size, v = 9 bytes
Disk Block ptr, P = 6 bytes

o(r + v) + p <= 1024
16o <= 1018
o =< 63

So Ans will be 63.

0 votes
0 votes
it is talking about leaf node just coz they didnt say anything and the value for record pointer is given .

so if u are suppose to consider it for and try to solve it then u will definately get the answer as 64 .

Related questions