Repository navigation
Conversation
…over worker threads Test-first phase 3 of the parallel query-time execution plan (tests E1-E6): every exact measure grouped by one or two keys (text and float) split 2-8 ways equals the one-thread run cell for cell and row for row; measure filters, NULLs and float keys with zero signs and NaN payloads; global and small inputs stay on one thread; the memory limit holds; two waves charge worker CPU; count distinct on a skewed key (the SB q3 shape). E1, E2, E5 and E6 fail (the exact Aggregate never splits: 0 partition tasks); E3 and E4 are guards and pass. 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
Aggregateruns on one thread. feat(executor): split grouped summary builds and merges by group key over worker threads #1563 split grouped summary builds and merges by group key over the worker pool, but a query-timeScan -> TimeRange -> Aggregate(an exact count distinct per group, an exact quantile per group) still reduces every row on the query thread. Example, measured at x4:SELECT target, count(DISTINCT user) … WHERE src IN $A … GROUP BY targetover 1 h (72 M rows read) takes 10.5 s. 30% of all data-plane samples sit on that one query thread inGroupTable::group_ids, the(group, tuple)distinct set andColumnParts. The raw read itself already runs on the pool.Aggregateby group-key hash into P parts on the worker pool, reusing feat(executor): split grouped summary builds and merges by group key over worker threads #1563's split, wave, part-count and key-order combine. Each part keeps its own group table and measure states; the parts' disjoint groups are emitted in the one-thread key order.Review guide
eval/2026-12-plannerfa22fa2. One file:crates/executor/tests/parallel_execution.rs, new tests after the feat(executor): split grouped summary builds and merges by group key over worker threads #1563 tests. They reuse that file'srows,run,run_withandfingerprinthelpers (every cell, float bits, row order).Behavior: before → after (planned)
grouped_aggregates_split_by_group_key_equal_the_sequential_aggregate(host),(host, fkey),(fkey, host), P = 2, 3, 5, 8split_aggregates_keep_filters_nulls_and_first_labelsglobal_and_small_aggregates_stay_sequentialemit_empty_global, 2 k rowsa_split_aggregate_over_the_memory_limit_failsMemoryLimitat P = 1 and 4split_aggregates_charge_worker_cpu_and_span_wavesa_split_count_distinct_equals_sequential_on_skewed_keysInterfaces
No interface change: the tests use
Operator::aggregate,Operator::with_measure_filters,Operator::with_emit_empty_globalandRunContext::with_parallelismas they are. The planned implementation adds no public item:Usage (end to end, after the implementation): a query run's
RunContext::with_parallelism(P)already reaches every operator. The exactAggregatecollects a first wave of input batches. When it has a group column and enough rows, it splits each batch by key hash into P order-kept parts. Each part folds its rows on a rayon worker with the existing per-chunk body:group_ids,ensure_groups, filter masks,update_measure. After each wave the run charges the parts' tables and states. At the end it orders the parts' groups by key, gathers the labels, finishes each measure per part, and interleaves the measures in that order.Tests
cargo test -p asap-executor --test executor parallel_execution::: 9 passed, 4 failed (E1, E2, E5, E6: "not split"), as intended for this phase.Spec and test plan: section 2–3 of the plan (parallel query-time execution). Measurement-only prototype numbers are in the comment below once taken.
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bpWvKMxYBvtAgpDYGp