The leafy "record" nodes contain
- pointer (a node "sorting address") to a node at the next level down the tree
- key value of the first (or last, depending on implementation) record in node
Such non-leafy βentriesβ are listed in key order, so when scanning (or binary search inside) a non-leaf node, it is known that the node at the next level down may contain the desired value.
Sheet node sheets contain complete data records: key value and everything else.
Therefore, βrealβ data is contained only in leaf nodes, but non-leaf nodes contain only [copy] of key values. for a very small fraction of the data (this proportion depends on the average number of data records found in the node sheet).
This is shown in the following image from the Wikipedia article on B + Trees 
The non-leaf node at the top (the only one in this simplified tree) contains only two entries without a node, each with a copy of the key value (bluish color) and a pointer to the corresponding node (gray color). This tree has only two levels, so the "entries" in the root directory of the node point to leaf nodes. You can imagine that there are additional levels (above the topmost tree shown below, call it "3-5 node"); if this were so, then the node above would contain (along with other similar entries) an entry with a key value of 3 with a pointer to a "3-5" node.
Also note that only key values ββ3 and 5 are contained in non-leaf nodes (i.e., not even all key values ββare reproduced in non-leaf nodes).
BTW in this example, non-leaf nodes contain the key of the last record in the next node (it will also work if the first record is used instead, there is a slight difference in how the search logic is implemented).
The leaf nodes contain the key value (in bluish color) and the corresponding data record (d1, d2 ... are shown in gray). The red pointer shown at the end of each node leaf points to the next node leaf, that is, the one that contains the very next data record in key order; these pointers are useful for βscanningβ a range of data records.
mjv
source share