18

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

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
neuromancer
  • 53,769
  • 78
  • 166
  • 223
  • 1
    Perhaps it would help if you gave some more context, such as a link, code, etc. – Justin Ethier Mar 23 '10 at 18:27
  • 1
    Any reference to b-tree-page? – systempuntoout Mar 23 '10 at 18:27
  • +1 only because this question isn't _quite_ bad enough to deserve a negative score, the OP's overall behavior aside. – Pops Mar 23 '10 at 19:00
  • @Phenom: a suggestion: click on your name. View the list of questions you've asked. For each question where there is no accepted answer (the number of votes will display as WHITE for these), click on it. Review the answers. Select the one that best answers the question. Repeat. – Cheeso Mar 23 '10 at 19:01

2 Answers2

26

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.

Jeffrey L Whitledge
  • 58,241
  • 9
  • 71
  • 99
3

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.

Dewfy
  • 23,277
  • 13
  • 73
  • 121