Skip to main content

Crate zu_vector

Crate zu_vector 

Source
Expand description

Typed columnar vectors and expression kernels (Spec/2064g/perf/02).

The executor’s tuple representation today is a Vec<Vec> with a 32-byte tagged enum per cell. This crate replaces the cell type with typed vectors: one contiguous buffer per column, validity as a bitmap, filters as selection vectors, strings as 16-byte views into shared buffers, and dictionary columns flowing as integer codes end to end. All vector memory comes from a per-morsel bump arena, so steady-state operator paths allocate nothing.

The factorized execution model is unchanged; only the bones are new. The old executor keeps running while this crate lands standalone, then the perf/03 executor consumes it natively.

Re-exports§

pub use kernels::BinOp;
pub use kernels::CmpOp;
pub use kernels::MathOp;
pub use kernels::MathPair;
pub use kernels::StrCut;
pub use kernels::StrFold;
pub use kernels::StrLen;
pub use kernels::StrNorm;
pub use kernels::StrTrim;
pub use kernels::TrimSet;

Modules§

kernels
Vectorized kernels (perf/02 section 3, perf/11).

Structs§

Bitmap
ChunkSet
A factorized tuple group: chunks[0] is the flat prefix, chunks[1..] are unflat list levels.
DataChunk
Dictionary
A sorted, deduplicated string dictionary, matching the on-disk dict encoding’s order so range predicates map to code ranges. Entry bytes are concatenated; ends[i] is the exclusive end of entry i.
MorselArena
Bump allocator for one morsel’s working memory.
PooledArena
An arena on loan from this thread’s pool.
Program
RawBuf
An untyped byte buffer handed out by the arena. Unique: not Clone, so mutable access cannot alias. The typed accessors are safe because the arena zeroes blocks at birth and every Pod type tolerates any bit pattern.
SelVector
StrBuffers
Shared byte buffers backing long string views. A vector holding views into a decoded segment chunk, or into a frame’s Arrow data buffer, keeps what it points at alive without copying it.
StrBuilder
Where a kernel puts the bytes of the strings it makes.
StrView
ValueVector

Enums§

Aux
Side data a vector may carry.
ExprOp
OwnedValue
A constant at the program boundary. Becomes a Constant vector at evaluation, so kernels see one encoding for literals and correlated single values alike.
PhysType
Physical types. A cell is one machine word or one 16-byte view, never a tagged enum: the tag lives once per vector, not once per value.
VecEncoding

Constants§

BLOCK_BYTES
Largest arena block. Matches the storage block so a decoded chunk and its working vectors have the same granularity.
INLINE_LEN
Longest string held entirely inside the view.
VECTOR_SIZE
Rows per vector, unchanged from the executor’s chunk fill width. A u16 selection index covers it with room to spare, and one vector spans exactly two of the storage layer’s 1024-row decode chunks.

Statics§

NO_BUFFERS
A vector whose views are all short carries no buffers at all, and a kernel resolving one still has to hand something to bytes. This is that something, and being a constant it costs nothing to have.

Traits§

Pod
Types a RawBuf may be viewed as: fixed layout, any bit pattern valid.

Functions§

const_str
A constant string vector: inline view when short, otherwise one shared buffer holding the payload.
node_group
The storage group a node reference falls in, for gather radix splits.
node_ref
Pack a node reference. Row is the table row (group * GROUP_ROWS + row within group), which fits 48 bits with 2^48 rows per table to spare.
node_row
node_table
str_vector
Convenience constructor for tests and result building: a flat string vector from byte slices, short ones inline, long ones packed into one shared buffer.
str_vector_from_ends
A flat string vector over the bytes and ends a decoded string column arrives in, where ends is the offset one past each string.

Type Aliases§

Reg