开发者

What is a B-tree page

开发者 https://www.devze.com 2022-12-24 15:12 出处:网络
I think I know what a B-tree is but what is a B-tree开发者_如何转开发 page?B-trees are a common data structure for very large collections, such as found in databases. They are often too large to be he

I think I know what a B-tree is but what is a B-tree开发者_如何转开发 page?


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.


B-tree is a tree with n-arity, so page is exactly 'n' cells to accommodate elements from current node and them reference down. For B+ tree it can be as meta-nodes (that keeps only references) and leaf-nodes to store data.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号