Skip to main content

Module art_node

Module art_node 

Source
Expand description

ART (Adaptive Radix Tree) node types with arena allocation.

Four node sizes matching the C++ ART implementation:

  • Node4: Up to 4 children — smallest, best for sparse branches
  • Node16: Up to 16 children — transitions from Node4 at 5 children
  • Node48: Up to 48 children — uses indirect index for compact storage
  • Node256: Up to 256 children — full fan-out, direct array

Each node carries:

  • A prefix (compressed path from parent)
  • A set of offsets (row IDs stored at this leaf)
  • overflow_offsets (additional row IDs for duplicate keys)

Port of C++ ArtPrimaryKeyIndex::Node from art_index.h (lines 95–145) and art_index.cpp.

Structs§

NodeBlock
A block of nodes in contiguous memory, used for arena allocation.

Enums§

ArtNode
An ART node — stores a prefix, child pointers, and value offsets.
NodeKind
ART node kind.

Constants§

EMPTY_MARKER
Marker for unused child slots in Node48’s indirect index.
NODE4_MAX
The growth threshold from one node type to the next.
NODE16_MAX
NODE48_MAX
NODE_BLOCK_CAPACITY
Maximum number of nodes per arena block.