Repository navigation
Perf CI: key the learned per-query thresholds by the query text - #121278
alexey-milovidov merged 1 commit into
Conversation
The CIDB query that learns the per-query performance thresholds aggregated GROUP BY test, query_index and returned any(query_display_name), while both consumers of the resulting historical-thresholds.tsv join it on all three columns: report_thresholds (compare.sh:1238-1243), which publishes changed_threshold/unstable_threshold, and flagged_queries in confirm_changes (compare.sh:921-926), which decides which queries enter the confirmation rerun. query_display_name is the query text while query_index is positional, so editing a test's substitution values changes the text at an unchanged index. The historical window then holds two display names for one (test, query_index), any() returns one of them per run, and the other text's join misses. join_use_nulls is not in CHPC_REPORT_LOCAL_QUERY_SETTINGS (compare.sh:46), so the miss yields 0 and ceil(greatest(0.15, 0, 0), 2) silently collapses to the 0.15 floor. A noisy micro benchmark judged by that floor is then reported slower on unrelated pull requests and on master, at a different set of query indices each run. This restores the producer's grain to the three columns the consumers already join on. 36a3734 narrowed it from group by test, query_index, query_display_name to GROUP BY test, query_index in the same edit that shrank the window from three months to one; the consumers were not touched, and the original grain still survives in the commented-out calibration query 20 lines below. double_check_perf.py carries a deliberate copy of the same query (its comment says so, and its consumer already keys a dict on all three fields), so it gets the same two-line fix. Measured on play.clickhouse.com, 2026-09-21, window today() - 1M - 1W .. today() - 1W: * 5596 (test, query_index) groups hold a bar and none loses it; rows emitted 5596 to 5644, rows read identical at 15.02e9. * 50 groups across 12 tests currently carry two display names, 18 of them in timeseries_to_grid_aggregation_functions, whose window substitution changed in 46d27f5. * Over 8 interleaved pairs the median paired server time is -0.67 s (faster in 5 of 8) and median peak memory drops 1514 to 1289 MiB, so exposure to the 10 s fetch timeout is unchanged at 3 of 8 in both arms. * On master c67f0b1, whose fetch succeeded, all four carrier-test indices published at the bare floor are ambiguous and all five that kept a learned bar are single-name, 9 of 9. Two pre-existing behaviours are unchanged: a brand-new query text gets the floor until it has more than 100 rows in the window, and grace_hash_join ClickHouse#3 and ClickHouse#7 have a 14-row variant against 1977 that now gets the floor rather than a bar pooled over two different query texts. Related: ClickHouse#116234 Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 gate finding plus 3 from my own
Noted, not blocking: the 1000-character trim does leave the identity column a partial Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-48:20260921-053700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20260921-043200 |
|
Workflow [PR], commit [a31e508] Summary: ✅
AI ReviewSummaryThis PR restores Final Verdict
|
1016976
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Key the learned per-query thresholds of
Performance Comparisonby the query text, so a query whose text changed is no longer judged by the bare0.15floor.Description
A query whose learned per-query bar goes missing is judged by the bare
0.15floor, so a noisymicro benchmark is reported
sloweron unrelated pull requests and on master, at differentindices each run.
The CIDB query that learns the bars groups by
(test, query_index)and returnsany(query_display_name); bothcompare.shconsumers join its output on all three columns.query_indexis positional, so after a test's query text changes the one-month window holds twonames for one index,
any()returns one, and the other text's join misses; with nojoin_use_nullsthat miss yields0and the bar collapses to the floor unnoticed.36a37341953ffnarrowed the grain without touching the consumers.The fix restores
query_display_nameto theGROUP BY, so each text keeps the bar learned fromits own timings. Column order, the floors, the multiplier and the
count() > 100cut-off areuntouched.
double_check_perf.pycarries a deliberate copy and gets the same fix.Measured today: none of the 5596 groups with a bar loses it (rows emitted 5596 to 5644); 50
groups in 12 tests carry two names; rows read identical at 15.02e9; over 8 interleaved passes the
median paired time is -0.67 s, peak memory 1514 to 1289 MiB, and 3 of 8 exceed the 10 s fetch
timeout in both arms. In the report below, all 4 indices published at
0.15are ambiguous and all5 with a learned bar are single-name.
Unchanged: a new query text gets the floor until it has over 100 rows in the window. Narrowed, 2 of
5596 groups:
grace_hash_join#3 and #7, where a 14-row variant against 1977 now gets the floorinstead of a bar pooled over two texts.
Does not overlap #121189 (restores the fetch) or #121090 (narrows the dashboard gate).
Related: #116234
Shape this fixes: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=c67f0b1829486bfa55e30e0ff050cfdcbb493e73&name_0=MasterCI&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%201%2F6%29
Workflow [PR]
Sync PR [sync-upstream/pr/121278]
Version info
26.10.1.382-master(included in26.10and later)