Repository navigation
Conversation
Tests for selecting series by a Scan's label predicates (label = 'v', IN, OR of = on one label) in raw reads: recognition and its negative cases, the label index, per-chunk selection and skipping, shared conversions kept apart by selection, series partition composition, and an end-to-end intent round answering the same with and without pushdown while reading only the bound host's rows. Stubs keep today's behaviour; RawData::read returns RawRead with rows in the time range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es select A raw read recognizes, among its Scan's predicates, label = 'v', label IN (...) and an OR of = on one label, on label columns (a SQL table's text columns, a metric's labels), and returns only the rows of the series they select; everything else is still applied by the executor, so the answers do not change. Per read, each series is judged once (a verdict by dense series id); per chunk, its distinct series are checked, a chunk with none selected is skipped without touching its rows, and the selected rows are copied in one pass (Chunk::select, which Chunk::in_partition now uses). A selected cut of a stored chunk is converted once per range request and selection, apart from the whole chunk's conversion. /metrics counts the query runs' raw reads, their rows in the time range and the rows returned (asap_query_raw_read_*_total). --no-label-pushdown (EngineOptions::label_pushdown) reads every series, for comparison. No global label index: the per-chunk check walks each chunk's series list either way (rows are in arrival order). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
feat/raw-read-label-pushdown
branch
from
December 3, 2026 20:14
ac2be99 to
ee2ac16
Compare
This was referenced Dec 3, 2026
Draft
…eads
The pushdown switch (EngineOptions::label_pushdown) covered query runs
only: ingestion runs built RunStore::for_partition, which always pushed
down, so a 'pushdown off' arm still pushed down at ingestion. Precompute
now carries the switch and passes it to each ingestion run's store, and
counts their raw reads apart (asap_ingestion_raw_read_*_total beside
asap_query_raw_read_*_total).
Test: label_pushdown_ingestion builds a view at ingestion from
data{job="a"} (one job of four): with pushdown the ingestion runs return
a quarter of the rows in their time ranges, without it every row, and
the answers are the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scan's predicates. In E6 drill_cnt x1, q2 (... FROM auth WHERE host IN $Y ... GROUP BY user) converted all 6.0 M rows ofauthevery round, only for the executor to keep the 10 bound hosts' rows: 1.69 s and 1.69 core-s per round.Scan's predicates (label = 'v',label IN (...), and anORof=on one label) and returns only the rows of the series they select. The executor still applies every predicate, so answers do not change.Review guide
feat/intent-trigger-rate(feat(data_plane): one intent round loop per clock; dependents triggered by the upstream's result #901), which E6/E7 run. Stack: feat(data_plane): intent round loop with parameter-slot binding: run a planned SIL intent round by round #900 → feat(data_plane): one intent round loop per clock; dependents triggered by the upstream's result #901 → this PR.data_plane/src/label_selection.rs: which predicates are recognized.data_plane/src/store.rs:RawData::read: selection per chunk.Chunk::select:in_partitionnow calls it.SeriesVerdicts.RawReads::get_or_select: the cache kept apart from whole-chunk conversions.RunStore::read_raw_data: the off switch and the counters.query.rs:run_storededuplicates two identical constructions.engine.rs,main.rsandmetrics.rs.push.rs:.batches.RawReads.''is never pushed down: a series lacking the label reads as''.69e98308), then the implementation.Behavior: before → after
The user writes (E6
drill_cnt.x1,auth= 10,000 rows/s over 10,000 Zipf-1.0 hosts × 10 users, stored as series{__name__=auth, host, user}):Planned query at a time (cost 177.9/s), q2 scans
authat query time with the bound predicatehost IN ('h17', ..)in itsScan.--no-label-pushdown)This serves the design intent in ASAPPlanner
docs/design_docs/physical-planning-and-deployment.md: filter pushdown is a hint the store may use, and the executor always re-filters. It also serves the E6/E7 latency goal: q2'sLATENCY <= 1000msis now met (it was missed before).Interfaces
data_plane/src/label_selection.rs(new)data_plane/src/store.rsdata_plane/src/query.rs,data_plane/src/engine.rs,data_plane/src/metrics.rs,data_plane/src/main.rsimpl QueryEngine { + /// Raw reads select series by the `Scan`'s label predicates when + /// `label_pushdown`, and count their rows in `counts`. + pub fn with_raw_reads(mut self, label_pushdown: bool, counts: Arc<RawReadCounts>) -> Self; } pub struct EngineOptions { + /// Raw reads return only the series a `Scan`'s label predicates select; + /// `false` reads every series in the time range (for comparison). Default true. + pub label_pushdown: bool, } pub struct Metrics { + /// Rows of the query runs' raw reads: in their time ranges, and returned. + pub query_raw_reads: Arc<RawReadCounts>, } + /// The same counts for the ingestion runs' raw reads. + pub ingestion_raw_reads: Arc<RawReadCounts>, +// ingestion.rs +impl Precompute { + /// The ingestion runs' raw reads select series by label predicates when + /// `label_pushdown`, and count their rows in `counts`. + pub fn with_raw_reads(mut self, label_pushdown: bool, counts: Arc<RawReadCounts>) -> Self; +} +// CLI: --no-label-pushdown (EngineOptions::label_pushdown = false; query AND ingestion runs) +// /metrics: asap_query_raw_reads_total, asap_query_raw_read_rows_in_time_range_total, +// asap_query_raw_read_rows_returned_total, and the same three with asap_ingestion_ (counters)Usage (end to end, as the E6 A/B ran it;
tests/intent_sil_modes.rs::label_pushdown_reads_the_bound_series_only_and_answers_the_samechecks the same flow in-process):Algorithm changes
Raw read series selection (
RawData::read,Chunk::select,SeriesVerdicts,RawReads::get_or_select)LabelSelection::from_predicates:BoolAnds.Utf8literals (=,IN, or anORof these on one label), collect label → values. Conjuncts on the same label intersect.Chunk::select:SeriesVerdicts::keepsonce per distinct series of the chunk. It holds one byte per dense series id, so each series is judged once per read.RawReadsunder (chunk, schema, selection), separate from whole conversions, so a range request's steps cut and convert it once. A chunk with no kept series is cached asNone.--no-label-pushdown, the path is the old one.''is ignored, because a series lacking the label reads as''. Tests:label_selection::tests(6): recognition and negative forms.store::tests(5): selected rows equal the row-wise read filtered; skipping; cache separation; composition with the series partition; unrecognized predicates.IN, andOR-of-equality on labels.!=, regex and ranges are left to the executor.push.rs) read without predicates.Decisions and open questions
Needs reviewer decision: None.
Decided (2026-12-03, user):
''.--no-label-pushdownswitch.Verification
Run on clnode009 (c8220, 40 threads).
cargo test -p data_plane --libcargo test -p data_plane(all integration tests)planner_executor_parity::push_precompute_answers_what_the_planner_executor_answers, "Too many open files" at the host's softulimit -n1024planner_executor_parityrerun withulimit -n 65536tests/label_pushdown_ingestion.rs(review I1)data{job="a"}(1 job of 4): pushdown on returns 1/4 of the ingestion rows in range, off returns all; answers identicalcargo test -p data_planeafter rebase onto #901 fb773b8 (ee2ac16,ulimit -n 65536)tests/intent_sil_modes.rslabel_pushdown_reads_the_bound_series_only_and_answers_the_samecargo clippy -p data_plane --lib --tests --bins -- -D warnings,cargo fmt --checkE2E evidence: E6 drill_cnt x1, query-at-a-time plan.
e6_feed(c8220-v1 scenario).Follow-ups
!=and regex matchers via a verdict per series: same mechanism, with a differentholds.--no-label-pushdownand are counted asasap_ingestion_raw_read_*.)🤖 Generated with Claude Code