Skip to main content

Module row_vec

Module row_vec 

Source
Expand description

RowVec - Cached row vector for zero-allocation table scans

This type wraps Vec<(i64, Row)> and returns it to a thread-local pool on drop. Uses a capacity-aware pool with best-fit allocation for efficient buffer reuse.

Pool Design:

  • Sorted by capacity (ascending) for O(log n) best-fit search
  • 16 slots to handle concurrent usage patterns
  • Best-fit allocation: returns smallest buffer >= requested capacity
  • Smart eviction: keeps larger buffers which are more versatile

Structs§

RowIdVec
Cached row ID vector that returns to thread-local cache on drop.
RowIdVecIntoIter
Owning iterator for RowIdVec.
RowVec
Cached row vector that returns to thread-local cache on drop.
RowVecIter
Draining iterator that preserves allocation for cache reuse. Uses ptr::read for zero-allocation iteration - no dummy rows created.

Functions§

clear_row_id_vec_pool
Clear the thread-local RowIdVec pool, releasing all cached buffers. Call this when dropping a database to prevent memory retention.
clear_row_vec_pool
Clear the thread-local RowVec pool, releasing all cached buffers. Call this when dropping a database to prevent memory retention.