Expand description
Segment Cache โ scan-resistant cache for decoded Arrow arrays from segment files.
Caches decoded column data keyed by (SegmentId, row_group, column_name).
Uses W-TinyLFU admission control with LRU eviction and a configurable
memory bound. The frequency sketch (Count-Min Sketch) prevents sequential
scan patterns from thrashing the cache by rejecting cold newcomers when
they would evict hotter items.
Also features singleflight dedup (only one loader per cache key), O(1) eviction via an LRU linked list, and probabilistic promotion to minimise write-lock contention on the hot read path.
Structsยง
- Cache
Load Error - Error returned to waiter threads when a singleflight cache load fails.
- Segment
Cache - LRU segment cache with configurable memory bound.
- Segment
Cache Key - Key for segment cache lookups.