Expand description
Multi-level segment pruning pipeline.
Eliminates segments from query processing before any data is decoded. This module is levels 3 and 4 of the six the read path applies:
- Bloom pruning — exclude segments that cannot contain the series key
- Stats pruning — exclude segments where column statistics exclude the predicate
The numbers are the read path’s, counted from the catalog, and they are spelled out because this header used to number these two steps 1 and 2 while the code below called them 2 and 3.
Levels 1 (catalog time range) and 2 (inverted tag index) happen one level
up, in Chronix::prune_segments,
where the candidate set is already scoped to one measurement: the catalog
entry carries min_timestamp/max_timestamp, so a separate time index
answered nothing the catalog could not.
Every level here may only ever fail towards more work. A segment with no bloom, or with no statistics for the filtered tag, is kept — both structures are derived from a segment’s sidecar and can lag the catalog, and pruning what has not been seen loses rows with no error anywhere.
Structs§
- Pruned
Segment - A segment that survived pruning.
- Pruning
Result - Result of the pruning pipeline: surviving segment entries and statistics.
- Pruning
Stats - Statistics about segment pruning during query execution.
Functions§
- prune_
entries - Prune a pre-filtered set of segment entries through bloom and stats levels.