Repository navigation
Run the uniq_states_read_merge performance queries above 1 s on a quarter of the states - #131912
Merged
alexey-milovidov merged 1 commit intoNov 16, 2026
Conversation
…rter of the states No existing query number or text changes: 2 queries are disabled and 2 copies appended as 5 and 6. The copies are queries 0 and 2 with `WHERE k < 1250000`: the first quarter of the one part of uniq_tiny_states (153 of 611 granules), the same mix of 2- and 9-element states; each of the 1000 GROUP BY sets ends two size degrees smaller at the same fill. Locally (official amd builds, perf.py, two repetitions on different NUMA nodes, L3 capped to 1 way and to 3 ways): per-row time of the copies 0.94-1.06 of the originals', per-row user time too; the GROUP BY copy keeps 0.86-0.995 of the effect of ClickHouse#111493 (9b9c059 -> d1a7da6, CI x1.14 amd / x1.20 arm on query 2), the finalizeAggregation copy keeps 0.94 of the effect of the ClickHouse#129553 CI build (CI x1.31 / x1.39 on query 0). The pair passes ran 15 runs per query and server. The copy's 80 MB of sets sits between arm's 36 MB and amd's 105 MB shared L3, so the regime and the effect were gated at both cache widths. Saving: about 27 s of query time per master perf job on amd, 25 s on arm. Related: ClickHouse#129258 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding), plus my own review (0 blocking findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261116-055500 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261116-042400 |
27 of 39 tasks
Contributor
|
Workflow [PR], commit [99ef46e] Summary: ✅
AI ReviewSummaryPR #131912 disables queries 0 and 2 in Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
alexey-milovidov
approved these changes
Nov 16, 2026
Merged
via the queue into
ClickHouse:master
with commit Nov 16, 2026
e86d939
384 of 386 checks passed
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.
Related: #129258
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Queries 0 and 2 of
uniq_states_read_merge.xmltake 1.30 / 2.29 s on MasterCI amd and 1.20 / 2.13 s on arm. Both read all 5M tinyuniqstates single-threaded: query 0 copies each state before finalizing it, and query 2 merges them into 1000 sets of 320 MB in total.No existing query number or text changes: 2 queries are disabled and 2 copies appended as 5 and 6. The copies are the same queries with
WHERE k < 1250000: the first quarter of the same part, with the same mix of 2- and 9-element states, and each GROUP BY set ends at a quarter of the size with the same fill. Locally the copies' per-row time is 0.94-1.06 of their originals', and so is their per-row user time.On the MasterCI builds before and after #111493, which CI measured 1.14x faster on amd / 1.20x on arm on query 2, the GROUP BY copy keeps 0.86-0.995 of its original's speedup. On the #129553 CI build, which CI measured 1.31x / 1.39x slower on query 0, the finalizeAggregation copy keeps 0.94 of its original's slowdown. Both hold in both seat orders, in two repetitions on different NUMA nodes, with L3 capped to one way (30 MiB) and to three (~90 MiB); CI's VMs share 105 MB on amd and 36 MB on arm.
The copies should take about 0.35 / 0.55 s on amd and 0.32 / 0.51 s on arm: about 27 s less query time per master perf job on amd and 25 s on arm. The copies restart the history of 2 queries.
Validation:
perf.pyon the final file runs only queries 1 and 3-6, also with CI's--max-queries 10, with no run trend.Workflow [PR]
Sync PR [sync-upstream/pr/131912]
Version info
26.11.1.2461-master(included in26.11and later)