MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / can_skip_numeric

Function can_skip_numeric

nodedb-columnar/src/predicate.rs:247–267  ·  view source on GitHub ↗

Block-skip logic for numeric predicates.

(op: PredicateOp, value: f64, stats: &BlockStats)

Source from the content-addressed store, hash-verified

245
246/// Block-skip logic for numeric predicates.
247fn can_skip_numeric(op: PredicateOp, value: f64, stats: &BlockStats) -> bool {
248 // Non-numeric columns (NaN stats) can never be skipped via numeric predicate.
249 if stats.min.is_nan() || stats.max.is_nan() {
250 return false;
251 }
252
253 match op {
254 // column > value → skip if block.max <= value
255 PredicateOp::Gt => stats.max <= value,
256 // column >= value → skip if block.max < value
257 PredicateOp::Gte => stats.max < value,
258 // column < value → skip if block.min >= value
259 PredicateOp::Lt => stats.min >= value,
260 // column <= value → skip if block.min > value
261 PredicateOp::Lte => stats.min > value,
262 // column = value → skip if value outside [min, max]
263 PredicateOp::Eq => value < stats.min || value > stats.max,
264 // column != value → skip only if entire block is that single value
265 PredicateOp::Ne => stats.min == value && stats.max == value,
266 }
267}
268
269/// Block-skip logic for integer predicates (lossless i64 comparison).
270///

Callers 2

can_skip_blockMethod · 0.85
can_skip_integerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected