0% found this document useful (0 votes)
224 views

B Tree in Dbms

This document discusses the structure and properties of B-tree nodes in a database management system. It explains that B-trees allow for multilevel indexing with record pointers present at both leaf and internal nodes, unlike B+ trees which only have data at leaf nodes. The root node can have between 2 and p child pointers and 1 to p-1 keys. Internal nodes can have between ceil(p/2) and p children and ceil(p/2)-1 to p-1 keys. Leaf nodes can have between ceil(p/2)-1 to p-1 keys. It then provides an example to calculate the order of a B-tree node given the block size, key size, record and block pointer sizes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views

B Tree in Dbms

This document discusses the structure and properties of B-tree nodes in a database management system. It explains that B-trees allow for multilevel indexing with record pointers present at both leaf and internal nodes, unlike B+ trees which only have data at leaf nodes. The root node can have between 2 and p child pointers and 1 to p-1 keys. Internal nodes can have between ceil(p/2) and p children and ceil(p/2)-1 to p-1 keys. Leaf nodes can have between ceil(p/2)-1 to p-1 keys. It then provides an example to calculate the order of a B-tree node given the block size, key size, record and block pointer sizes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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

You might also like