Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a B-tree page

I think I know what a B-tree is but what is a B-tree page?

like image 307
neuromancer Avatar asked Mar 23 '10 18:03

neuromancer


People also ask

What does B-tree mean?

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.

What is B-tree give an example?

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.

How many pages is a B+ tree?

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.

What is a B-tree index?

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.


1 Answers

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.

like image 160
Jeffrey L Whitledge Avatar answered Jan 22 '23 19:01

Jeffrey L Whitledge