From e596e0938253f1ff40a287aec57cfe326dca9365 Mon Sep 17 00:00:00 2001 From: discord9 <55937128+discord9@users.noreply.github.com> Date: Tue, 20 Oct 2026 20:07:55 +0800 Subject: [PATCH] docs(promql): state the real reason an instant selection needs no ordering check `select_instants` reads one series' complete axis, so the executor must collect a series to its last chunk before evaluating it: a single buffer closed by `is_last` and keyed by nothing else. That needs each series' chunks contiguous, which `Contiguous` and `KeyThenTime` both guarantee, and `Interleaved` never reaches it because `unpack_raw_series` rejects that ordering at the raw-frame boundary. The comment said the opposite: that interleaved input was enough because `select_instants` holds no cross-series state. The conclusion stood, but the stated reason named a property the executor does not have. Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> --- src/promql/src/native/plan.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/promql/src/native/plan.rs b/src/promql/src/native/plan.rs index 6cca42134f3..fa1de823d3a 100644 --- a/src/promql/src/native/plan.rs +++ b/src/promql/src/native/plan.rs @@ -335,8 +335,12 @@ impl NativeNode { // field. ensure_same_fields(&input.output, &self.output, "an instant selection")?; ensure_grid(&self.output, &op.output_grid, "an instant selection")?; - // `select_instants` reads one series at a time and holds no cross-series state, so - // an interleaved input is enough for it: no ordering check here. + // `select_instants` reads one series' complete axis, so the executor collects a + // series to its last chunk first: a single buffer closed by `is_last` and keyed by + // nothing else. That needs each series' chunks contiguous, which `Contiguous` and + // `KeyThenTime` both guarantee; `Interleaved` never reaches it because + // `unpack_raw_series` rejects that ordering at the raw-frame boundary. So no check + // is needed here. } NativeExpr::Window { input, op } => { input.validate()?;