Question

Values that fit into a b-tree node (represented by a page, typically 4kb) are directly put into the nodes which are then flushed to disk. That is a node can roughly have 1000 4-byte values. But how do large values the size of which exceeds the size of nodes are written to disk? How are large values represented in nodes in memory? Obviously a node cannot have a 15kb value.

Était-ce utile?

La solution

Tree nodes and disk blocks are two different layers. Node is a logical level, while blocks is physical. A node can take more space than the size of the block and it is an often situation. It's up to IO code how to split the node into multiple blocks. Related blocks (empty ones or the ones that belong to one node) may be linked to each other via some 'nextBlockId' property.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top