Skip to main content

Module pruning

Module pruning 

Source
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:

  1. Bloom pruning — exclude segments that cannot contain the series key
  2. 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§

PrunedSegment
A segment that survived pruning.
PruningResult
Result of the pruning pipeline: surviving segment entries and statistics.
PruningStats
Statistics about segment pruning during query execution.

Functions§

prune_entries
Prune a pre-filtered set of segment entries through bloom and stats levels.