Skip to main content

Module payload_index

Module payload_index 

Source
Expand description

In-memory payload bitmap indexes for vector-primary collections.

Each indexed field stores a HashMap<PayloadKey, RoaringBitmap> mapping distinct field values to the set of HNSW node ids that carry that value. Pre-filter queries intersect/union bitmaps to produce a node-id allow-set that is passed directly into HNSW search, eliminating costly post-filter passes for high-selectivity predicates.

Ordering invariant: callers must call insert_row after the HNSW node id is assigned so that the id is stable. Similarly, delete_row should be called before or after HNSW deletion is attempted — the bitmap and the HNSW graph are always consistent after a successful pair.

Structs§

PayloadIndex
Bitmap index for a single payload field.
PayloadIndexSet
Set of per-field payload bitmap indexes for a collection.
PayloadIndexSetSnapshot
Serializable snapshot of the full PayloadIndexSet.
PayloadIndexSnapshot
Serializable snapshot of a single PayloadIndex for checkpointing.

Enums§

FilterPredicate
A structured filter predicate that can be evaluated against the bitmap indexes. Mirrors the SQL WHERE predicates the planner builds.
PayloadIndexBitmaps
Per-field bitmap storage. Equality indexes use a hash map (O(1) point lookup); Range indexes use a B-tree (O(log n) point + range scan over keys).
PayloadIndexKind
Re-export the kind enum from nodedb-types so the on-disk snapshot and the DDL config wire format share a single definition. Storage kind for a payload bitmap index. Equality fields use a HashMap<key, bitmap> (O(1) lookup); Range fields use a BTreeMap for sorted range scans; Boolean is a low-cardinality equality variant.
PayloadKey
A deterministic, hashable representation of a Value used as a bitmap key.