- Order definition in this QS: based on no of keys
- Order will be based on maximum occupancy which is given as $2P$ keys
- We need to compare P values with $B$ and $B+$ Tree
$\begin{align*} &\text{B Tree For any node }\rightarrow \\ &\left ( \text{no-of-keys} \right )*\left [ \text{key-size} + \text{record-ptr-size} \right ] + \left ( \text{no-of-keys+1} \right ) * \left [ \text{block-ptr-size} \right ] \leq 2048\\ &\Rightarrow 2P*\left [ 20+25 \right ] + \left ( 2P+1 \right )*\left [ 30 \right ] \leq 2048 \\ &\Rightarrow 90P+60P + 30 \leq 2048 \\ &\Rightarrow P = \left \lfloor \frac{2018}{150} \right \rfloor \\ &\Rightarrow P = 13 \\ \end{align*}$
$\begin{align*} \\ \hline \\ &\text{B+ Tree For Leaf node }\rightarrow \\ &\left ( \text{no-of-keys} \right )*\left [ \text{key-size} + \text{record-ptr-size} \right ] + 1 * \left [ \text{block-ptr-size} \right ] \leq 2048\\ &\Rightarrow 2P*\left [ 20+25 \right ] + 1*\left [ 30 \right ] \leq 2048 \\ &\Rightarrow 90P+ 30 \leq 2048 \\ &\Rightarrow P = \left \lfloor \frac{2018}{90} \right \rfloor \\ &\Rightarrow P = 22 \\ \end{align*}$
$\begin{align*}\\ \hline \\ &\text{B+ Tree For NON-Leaf node }\rightarrow \\ &\left ( \text{no-of-keys} \right )*\left [ \text{key-size} \right ] + \left ( \text{no-of-keys+1} \right ) * \left [ \text{block-ptr-size} \right ] \leq 2048\\ &\Rightarrow 2P*\left [ 20 \right ] + \left ( 2P+1 \right )*\left [ 30 \right ] \leq 2048 \\ &\Rightarrow 40P+60P+30 \leq 2048 \\ &\Rightarrow P = \left \lfloor \frac{2018}{100} \right \rfloor \\ &\Rightarrow P = 20 \\ \end{align*}$
In this question, they have given record pointer size and In $B+$ record pointers are there in only leaf nodes.
- Considering leaf nodes of $B+$
- Difference between order of B tree with B+ Tree is $-9$
- Considering internal nodes of $B+$
- Difference between order of B tree with B+ Tree is $-7$