I think I know what a B-tree is but what is a B-tree page?
In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for nodes with more than two children.
Example of B-TreeThis supports basic operations like searching, insertion, deletion. In each node, the item will be sorted. The element at position i has child before and after it. So children sored before will hold smaller values, and children present at right will hold bigger values.
Structure of a B-tree Table. The smallest B-tree has four pages, one of each type. Note: If a secondary index is modified to B-tree, it cannot contain data pages. Instead, the leaf pages of the secondary index reference the main table's data pages.
A B-tree is a balanced tree—not a binary tree. Once created, the database maintains the index automatically. It applies every insert , delete and update to the index and keeps the tree in balance, thus causing maintenance overhead for write operations.
B-trees are a common data structure for very large collections, such as found in databases. They are often too large to be held in memory at once, so they are stored in a file on disk, and only the portions necessary for the current operation are read into memory.
A piece of data that is stored to disk (and read into memory) as a unit is called a page. It is typical for a B-tree to store the number of records in a single node that make the node size equal to the natural page size of the file-system. In this way, the disk acceses can be optimized.
For example, if the file system naturally operates on 16 kb blocks of data, and if the size of the records in the B-tree is 500 b (including the links to the next level of nodes) then 32 records could be stored in the node, making the node size equal to the page size, and allowing the disk accesses to be optimized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With