Repository navigation
Pin the part layout in the prewhere_subcolumns performance test - #128387
alexey-milovidov merged 2 commits into
Conversation
`where n.null` is pruned by the automatic column statistics (basic, null_count) to the one part that holds row 0. The unpinned INSERT writes 8 parts (7 x 130818 + 84274 rows), and a background merge of parts 1-6 into a 784908-row part can complete before `perf.py --stop-merges` stops merges, which it does only after BOTH servers finished their fill. The server that fills faster gives that merge more time, so a fill-speed difference between the two compared binaries decides which layout each side measures: one server read 784908 rows / 229 marks, the other 130818 / 39, and the dashboard confirmed a +30% regression of query ClickHouse#1 on 11 unrelated PRs in Performance Comparison (arm_release, 4/6), where the official build used as the reference filled in ~3.9 s vs ~2.7 s. The confirmation reruns refill the table, so they repeat the asymmetry. Stop merges for the table before the INSERT and cut the parts by rows (max_insert_threads = 1, max_block_size = 65536, min_insert_block_size_rows = 131072, min_insert_block_size_bytes = 0), then assert the layout (8 parts, 7 x 131072 + 82496) with throwIf, the same pin as join_convert_full_to_left_or_right.xml (ClickHouse#119175). Queries are unchanged; query ClickHouse#1 now reads one 131072-row part on every server. Validated with the official master build and two local servers: the master XML with the merge allowed to finish reads 784908 rows / 229 marks (3/3); with the pin every trial reads 131072 rows and an OPTIMIZE is refused; perf.py --stop-merges with one server CPU-throttled gives 784908 vs 130818 on master and 131072 on both servers with the pin; removing either pin makes the throwIf fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous check accepted any 8-part layout with one 131072-row part; the fill now requires 7 x 131072 + 82496 rows in block order. 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 rounds; 1 finding; plus my own cold review).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261031-155900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261031-152400 |
|
cc @egor-click, could you review this and add the |
|
Workflow [PR], commit [e537a88] Summary: ✅
AI ReviewSummaryPR #128387 makes the Final VerdictStatus: ✅ Approve |
24037cf
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
prewhere_subcolumnsperformance test now gives every server the same part layout, so itswhere n.nullquery no longer reports a false regression.Description
Related: #119175 (same fixture pin). No related open issue found.
Performance Comparison (arm_release, master_head, 4/6)reportedprewhere_subcolumns #1(where n.null) as a confirmed +30% regression on 11 unrelated PRs on 2026-10-30/31, e.g. report 1, report 2.The two servers measured different tables: the slower one read 784908 rows (229 marks), the other 130818 (39). The column statistics prune
n.nullto the one part holding row 0. TheINSERTwrites 8 parts, and a background merge of the first 6 can finish beforeperf.py --stop-mergesstops merges, which happens only after both servers filled. The server that fills faster gives that merge more time, so a fill-speed difference between the two binaries decides the layout, and the confirmation reruns refill and repeat it.The test now stops merges for its table before the
INSERTand cuts parts by rows (max_insert_threads = 1,max_block_size = 65536,min_insert_block_size_rows = 131072,min_insert_block_size_bytes = 0), the same pin asjoin_convert_full_to_left_or_right.xml, then checks the layout withthrowIf. The queries are unchanged;#1reads 131072 rows on every server.Validation with the official master build and two local servers: the master XML with the merge allowed to finish reads 784908 rows / 229 marks (3/3);
perf.py --stop-mergeswith one server CPU-throttled reproduces the 784908 vs 130818 pair on master (2/2) and gives 131072 on both servers with this change (2/2, plus 3/3 unthrottled). Removing either pin makes thethrowIffail.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/128387]
Version info
26.11.1.992-master(included in26.11and later)