Sei sulla pagina 1di 1

6/5/2017 BTreeinDbms

Btree
Btree is an example of multilevel indexing. Record pointers will be present at leaf nodes as well as on internal
nodes.
Whereas in B+ tree we will have data record pointers only at leaf level.
Now we will discuss about each of the node separately:

Root
Children:Root can have children/pointers between 2 and p inclusive.
Keys:Root can have keys between 1 to p1 inclusive.

Internal Node
Children:Internal Node can have children/pointers between ceilp/2 and p inclusive.
Keys:Internal Node can have keys between ceilp/21 to p1 inclusive.

Leaf Node
Keys:Lead Node can have keys between ceilp/21 to p1 keys inclusive.

QuestionIn a B tree, suppose search key is 9 Bytes long, disk block size is 512 Bytes, record pointer is 7 Bytes,
Block pointer is 6 Bytes, then calculate the order of Btree node.
Answer

So following above structure :


Lets say n pointers/children we are having :
n*p + n1key_size + record pointer size <= Block Size

So, n*6 + 5*9+7 <= 512 n <= 24


Note 1If we get any fraction data then take the floor of value
Note 2If you are confused which one to take record pointer and which one to take block pointer then take the
bigger one as record pointer.

http://scanftree.com/dbms/btree 1/1

Potrebbero piacerti anche