Repository navigation
Run the aggregation_in_order_if_null_map performance queries in one thread - #127697
alexey-milovidov merged 1 commit into
Conversation
On the amd perf runners the six queries run the 8-stream in-order pipeline (AggregatingInOrderTransform x 8 -> FinishAggregatingInOrderTransform -> MergingAggregatedBucketTransform x 8). Its wall time is bimodal per server process: on master (2026-10-22..24) query ClickHouse#5 (`corr(x, w)`) was over the report floors in 33 of 110 amd runs, with the same CPU time in both modes and about 127 ms more off-CPU time across the threads in the slow one. With `max_threads = 1` the pipeline is AggregatingInOrderTransform -> FinalizeAggregatedTransform: the per-group -If / -Null adapter code this test measures still runs on the same 5M rows and 625000 groups, and the cross-stream stage (not the subject of this test) is gone. Results are identical at 1 and 8 threads. Same shape as aggregation_in_order_partial_key.xml, which is not over the floors on either arch. Related: ClickHouse#100759 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings over 2 passes).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261024-071700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261024-070900 |
|
cc @egor-click, could you review this and add the |
|
Workflow [PR], commit [71e9d4d] Summary: ✅
AI ReviewSummaryThe PR sets Final VerdictStatus: ✅ Approve |
6e5517c
Related: #100759
Related: #118025
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
aggregation_in_order_if_null_mapperformance test runs its queries withmax_threads = 1, so its timings no longer depend on how the threads of the multi-stream in-order aggregation interleave.Description
aggregation_in_order_if_null_mapis rank 8 in #100759. From 2026-10-22 to 2026-10-24 on master, #5 (corr(x, w)) was over the report floors in 33 of 110 amd runs and 0 of 112 arm runs; #0-#4 in 2-7 of 112 on amd. CI flagged itunstablein 5 of those amd jobs, e.g. amd_release 4/6 (#5 0.047 vs 0.060 s).On amd both servers run with 8 pinned CPUs and
max_threads = 8, so each query runs 8AggregatingInOrderTransforms intoFinishAggregatingInOrderTransformand 8MergingAggregatedBucketTransforms. Every run reads the same part (1 part, 611 marks) with about the same CPU time, but the pipeline threads' off-CPU time varies per run and per server process (about +114 ms for #5 in the slow mode), so the 25-60 ms queries are bimodal and the two servers often sit in different modes.With
max_threads = 1the pipeline isAggregatingInOrderTransform -> FinalizeAggregatedTransform. The-If/-Nulladapter code this test was added for (#118025, mine) still runs inAggregatingInOrderTransformon the same 5M rows and 625000 groups; the 8-stream merge is no longer measured here.aggregation_in_order_partial_key.xmlalready uses this shape and is not over the floors on either arch. No product change; the queries now take 0.08-0.18 s.Validation: two local servers with the same master release binary, set up like the amd job (8 pinned CPUs,
max_threads = 8), restarted for each of 6 cycles of 7 runs per query. Old: 10 of 36 query-cycles over the floors, #5stat_thresholdmedian 0.243. New: 0 of 36, #5 median 0.012, max 0.016. Results are identical at 1 and 8 threads.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127697]
Version info
26.11.1.746-master(included in26.11and later)