Repository navigation
Conversation
…unks Test-first phase 3 of the parallel query-time execution plan (D1): a raw read whose chunks are converted on the worker pool returns the sequential read's batches cell for cell and in order, and its rows in the time range, for a metric and a keyed table, key and field predicates, with and without the read cache and with a series partition. RawData::read_with(.., p) is a stub that reads on the calling thread, so the chunk-task assertion fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp
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
--query-parallelism > 1(RunStore::with_parallel_shard_reads), so the read is split at mostingest_threadsways (12 on a 48-thread data plane), and a shard holding a large share of the window's chunks bounds it. This is part 2 of the parallel query-time execution plan. Part 1, the exactAggregatesplit, is ASAPPlanner#1571 and carries most of the gain: in the x4 SBq3profile, 58% of samples were already on the pool for the read and 30% on the one query thread aggregating.ppool threads (RawData::read_with(.., p), a stub today) returns the sequential read's batches cell for cell, in order, with the same rows in the time range. It holds for a metric and a keyed table, key and field predicates, with and without the cross-step read cache, and with a series partition.Review guide
perf/x4-sb-scan(perf(data_plane): judge a keyed table's field restrictions once per series per read #910, ba11870), stacked so the bitmask field check is folded in.data_plane/src/store.rs:RawRead::chunk_tasks, theRawData::read_withstub (readcalls it with 1), and the testa_chunk_parallel_read_equals_the_sequential_read.read_withconverts the in-range chunks withpar_iterover (pane, chunk) in order and collects them in order.RunStore::with_read_parallelism(p)replaceswith_parallel_shard_reads(bool): shards and chunks share one budget, the query's--query-parallelismon the--query-pool-threadspool.Behavior: before → after (planned)
login_failat x4 (360 panes x 12 shards)ptasks over (shard, chunk); same batches, same order--query-parallelism 1Interfaces
data_plane/src/store.rspub(crate) struct RawRead { pub batches: Vec<Batch>, pub rows_in_time_range: u64, + /// Chunks the read converted on the worker pool (0: read on the calling thread). + pub chunk_tasks: usize, } impl RawData { pub(crate) fn read(&self, metric, request, reads, partition) -> Result<RawRead, Error>; + /// `read` with its chunks converted on up to `parallelism` pool threads; same batches, same order. + pub(crate) fn read_with(&self, metric, request, reads, partition, parallelism: usize) -> Result<RawRead, Error>; }Usage (end to end, after the implementation):
QueryEngine::run_storebuilds the run'sRunStorewith the query parallelism. AScancallsRunStore::read_raw_data, which reads each shard throughRawData::read_with(.., p): selection and conversion per chunk on the pool, batches collected in pane and chunk order. The executor's splitAggregate(ASAPPlanner#1571) then reduces them on the same pool.Tests
cargo test -p data_plane --lib store::: 22 passed, 1 failed. The failing test is the new D1, "chunks not read on the pool", as intended for this phase.field_restrictions_on_many_series_match_a_plain_filterpasses.Spec and test plan: the parallel query-time execution plan, sections 2–3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp