Repository navigation
Run queries #0-#2 of the aggregation_in_order performance test in one thread - #133450
alexey-milovidov merged 1 commit into
Conversation
On amd, queries 0 and 2 differ by more than 10% between the two servers in 27% / 24% of 501 master reports (18% / 13% of runs over the report's floors, 76 flags in 430 commits, 2026-11-12..11-21); arm 4% / 1%. Both read one part in order: its 12208 marks are split among the max_threads = 8 streams up front (no work stealing), so the query takes as long as its slowest stream. The amd job pins both servers to the same 8 CPUs. Two inputs make one stream slower: - In 328 of the 501 reports neither side waits for a CPU, yet 97 still differ by more than 10%. There the log ratio of the two servers' wall times follows the log ratio of their CPU times with slope 3.2 (correlation 0.84), so an ordinary 2-6% per-side CPU difference becomes three times that. Single-threaded in-order queries keep it 1:1 (aggregation_in_order_if_null_map, aggregation_in_order_partial_key: more than 10% in 0-1.6% of reports). - The rest are run-queue waits: a background thread of either server, mostly the trace_log flush, takes one stream's CPU (slow samples wait 43-48 ms for a CPU against 3 ms). Disable query 0 and the substitution query (1, 2) and append them with max_threads = 1 (4-6), as was done for aggregation_in_order_if_null_map. Query 3 keeps measuring the merge of several in-order streams. No existing query number or text changes. 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; 0 findings on the diff and the description, two runs). My own review: 2 nits on the description text, both resolved before publishing.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261121-223900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261121-222300 |
|
Workflow [PR], commit [cc94961] Summary: ✅
AI ReviewSummaryThe PR preserves the original Final VerdictStatus: ✅ Approve |
87867a5
Related: #100759
Related: #127697
Related: #133126
Related: #129366
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
aggregation_in_orderperformance test runs itsGROUP BY CounterIDandGROUP BY CounterID, EventDatequeries withmax_threads = 1as new copies, so their timings no longer depend on the slowest of the streams the part is split into.Description
Round 4 of #100759. On amd master 2026-11-12..11-21, the servers' medians of #0 (
GROUP BY CounterID, 59 ms) and #2 (GROUP BY CounterID, EventDate, 65 ms) differ by more than 10% in 27% / 24% of 501 reports, 18% / 13% of runs are over the floors, 76 flags in 430 commits. arm: 4% of runs, 1% over the floors.Both read one part in order:
spreadMarkRangesAmongStreamsWithOrdersplits its 12208 marks among themax_threads = 8streams up front (no work stealing), so the query lasts as long as its slowest stream, and the amd job pins both servers to the same 8 CPUs. In 328 of the 501 reports neither side waits for a CPU, yet 97 differ by more than 10%: their wall-time ratio follows their CPU-time ratio with slope 3.2, tripling an ordinary 2-6% per-side CPU difference. The rest are run-queue waits: a background thread of either server, mostly thetrace_logflush (my #133126), takes a stream's CPU.No query number or text changes: #0 and the substitution query (#1/#2) are disabled (#129366) and appended with
max_threads = 1as #4-#6, as #127697 did foraggregation_in_order_if_null_map. #3 still measures the merge of 8 in-order streams. The copies take about 0.3-0.4 s per run.Validation on two servers set up like the amd job (8 pinned CPUs,
max_threads = 8, same 12208 marks): in 12 restart cycles the server difference of #0 / #2 exceeds the CPU difference by over 3 points in 9 / 4 (slope 1.27 / 3.24), of the copies in none (1.00 / 0.99). One busy thread on the 8 CPUs makes #0 / #2 wait 33 / 43 ms more and run 1.31x / 1.50x slower, the copies 1.00x / 0.99x, no wait. Same marks read, same result.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133450]
Version info
26.12.1.150-master(included in26.12and later)