Expand description
Immutable index segments and their lifecycle building blocks.
Builders write a complete segment, readers expose its text, stored-field,
and vector data, and native mergers combine committed segments. Publication
and deletion are coordinated at the index layer by
crate::merge::SegmentManager.
Modules§
- chunk_
map - Virtual-id maps of chunked text fields (
seg_<id>.chunks). - pin
- Hot-metadata pinning: budgeted residency for per-query-mandatory structures (a meta/data residency split).
Structs§
- AnnHealth
- Cheap structural health of one ANN payload, computed from the in-memory run directory in O(runs) — payload bytes are never touched.
- Async
Store Reader - Async document store reader - loads blocks on demand
- BmpDim
Stats - Summary statistics for per-dimension postings in a BMP sparse index.
- BpBudget
- CPU/depth budget for a BP pass. BP is an anytime algorithm: stopping at any depth or deadline still yields a valid permutation, and because the output layout becomes the next pass’s input order, repeated budgeted passes warm-start and deepen (top levels converge in ~0 swaps, the budget flows to deeper levels).
- Dense
Plan Cache - Per-query dense plan caches, shared by every segment scorer the query spawns. Both members are query-global: the IVF-TQ probe route and its LUTs depend only on the query and index-level artifacts, and the TQ LUTs depend only on the query and the schema dimension.
- Eager
Parallel Store Writer - Parallel document store writer - compresses blocks immediately when queued
- Field
Stats - Field statistics for BM25F scoring
- Flat
Vector Data - Flat vector binary format helpers for writing.
- Lazy
Flat Vector Data - Lazy flat vector data — zero-copy doc_id index, vectors via range reads.
- Memory
Breakdown - Detailed memory breakdown by component
- Merge
Stats - Statistics for merge operations
- Published
Index Generation - Immutable schema and trained-vector artifacts published with one segment generation. Readers retain this object with their segment references, so a vector-index ALTER cannot pair old segments with new routing parameters.
- RawStore
Block - Raw block info for store merging (without decompression)
- Scann
Trained Artifact Bytes - Mmap/Arc-backed bytes for one validated global ScaNN generation. The full artifact is fingerprinted exactly once at open; query/merge compatibility reads the cached identity/config instead of rehashing the centroid plane.
- Segment
Builder - Segment builder with optimized memory usage
- Segment
Builder Config - Configuration for segment builder
- Segment
Builder Stats - Statistics about segment builder state
- Segment
Files - Paths for segment files
- Segment
Id - Unique segment identifier (UUID7-like: 48-bit timestamp + 80-bit random)
- Segment
Merger - Segment merger - merges multiple segments into one
- Segment
Meta - Segment metadata
- Segment
Reader - Async segment reader with lazy loading
- Segment
Snapshot - RAII guard that holds references to a snapshot of segments. When dropped, releases all segment references and triggers deferred deletion.
- Segment
Tracker - Tracks segment references and pending deletions
- Sparse
Index - Sparse vector index for a field: lazy block loading via mmap.
- Store
Merger - Store merger - concatenates compressed blocks from multiple stores without recompression
- Trained
Vector Structures - Trained vector index structures for rebuilding segments with ANN indexes
- Vector
Search Result - Vector search result with ordinal tracking for multi-value fields
Enums§
- Vector
Index - Production ANN payloads for float IVF-PQ and packed-binary IVF.
Constants§
- DEFAULT_
DICT_ SIZE - Default dictionary size (4KB is a good balance)
- STORE_
BLOCK_ SIZE - Block size for document store (16KB). Smaller blocks reduce read amplification for single-doc fetches at the cost of slightly worse compression ratio. Zstd dictionary training recovers most of the compression loss.
Functions§
- delete_
segment - Delete segment files from directory (all deletions run concurrently).
- dequantize_
raw - Dequantize raw bytes to f32 based on storage quantization.
- deserialize_
document - Deserialize all fields from document bytes.
- deserialize_
document_ fields - Deserialize only specific fields from document bytes.
- serialize_
document - Binary document format: num_fields: u32 per field: field_id: u16, type_tag: u8, value data 0=Text: len:u32 + utf8 1=U64: u64 LE 2=I64: i64 LE 3=F64: f64 LE 4=Bytes: len:u32 + raw 5=SparseVector: count:u32 + count*(u32+f32) 6=DenseVector: count:u32 + count*f32 7=Json: len:u32 + json utf8
- serialize_
document_ into - Serialize a document into a reusable buffer (clears it first). Avoids per-document allocation when called in a loop.