5,956 views

Consider a table $T$ in a relational database with a key field $K$. A $B$-tree of order $p$ is used as an access structure on $K$, where $p$ denotes the maximum number of tree pointers in a B-tree index node. Assume that $K$ is $10$ $bytes$ long; disk block size is $512$ $bytes$; each data pointer PD is $8$ bytes long and each block pointer PB is $5$ bytes long. In order for each $B$-tree node to fit in a single disk block, the maximum value of $p$ is

1. $20$
2. $22$
3. $23$
4. $32$

for finding the order in B+ tree and B tree is both the formulas are different or same ??
different

It is $\bf{23}.$

$(p-1)(\text{key_ptr_size} + \text{record_ptr_size}) + p. (\text{block_ptr_size}) \leq 512$
$\implies (p-1) (10+ 8) + p \times 5 \leq 512$
$\implies 23p \leq 530$
$\implies p \leq 23.04$

So, maximum value of $p$ possible will be $23.$

I think your answer is right but we need to do p=23-1=22 bytes as 1 byte will be used to store information.. that is as per NAVATHE book...
i am not understanding why record pointer is considered in internal nodes?
Got it... In B tree records are also present in internal nodes. Silly confusion :)

(n-1)(key pointer size + record pointer size) + n. (block pointer size) <= 512

=> (n-1) (10+8) + n (5) <= 512

=> n = 23

1
8,192 views