Skip to main content

Module chunk_state

Module chunk_state 

Source
Expand description

Unified chunk state tracking for factorized execution.

This module provides ChunkState for centralized state management, inspired by LadybugDB’s FStateType pattern. Key benefits:

  • Cached multiplicities: Computed once, reused for all aggregates
  • Selection integration: Lazy filtering without data copying
  • O(1) logical row count: Cached, not recomputed

§Example

let mut state = ChunkState::unflat(3, 1000);

// First access computes, subsequent accesses use cache
let mults = state.get_or_compute_multiplicities(|| expensive_compute());
let mults2 = state.get_or_compute_multiplicities(|| unreachable!());
assert!(std::ptr::eq(mults.as_ptr(), mults2.as_ptr()));

Structs§

ChunkState
Unified chunk state tracking metadata for factorized execution.
FactorizedSelection
Hierarchical selection for factorized data.

Enums§

FactorizationState
Factorization state of a chunk (flat vs factorized).
LevelSelection
Selection state for a single factorization level.