Repository navigation
Make the clickbench_parquet_short fixture identical on both perf servers - #125513
Conversation
Each performance-comparison server writes its own copy of the fixture with `generateRandom(...) LIMIT 1000000`. With the profile's `max_threads = 12` the generator runs as 12 parallel streams and `LIMIT` keeps whichever blocks arrive first, so the two copies have different content. Since the bloom filter is checked before the dictionary page, query 5 (`WHERE UserID = <constant absent from the data>`) is answered from the bloom filters of the 16 row groups alone. When one copy has a bloom filter false positive, that server reads and decodes one `UserID` dictionary page on every run (33 decoding tasks instead of 32, ~530 KB more read), which is +25-40% on a ~4 ms query and is reported as a regression (or an improvement) of an unrelated PR. Run the generator in a subquery with `max_threads = 1`. The outer `INSERT` keeps the parallel Parquet encoding, so the fill stays at ~1.3 s per server, and both servers write byte-identical files. The queries are unchanged. 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) plus my own review of the same head: no findings. Checked: the Session id: cron:clickhouse-review-slot-10:20261012-212800 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261012-211100 |
|
Workflow [PR], commit [f0cecf5] Summary: ✅
AI ReviewSummaryThis PR makes Findings
Final Verdict |
`max_threads = 1` makes the fixture independent of thread scheduling, but its content still depended on the block-size defaults: `generateRandom` shrinks `max_block_size` to `preferred_block_size_bytes` divided by its row-size estimate (16545 rows here), its random stream is consumed block by block, and the Parquet writer cuts row groups at block boundaries (16 groups of 66180 rows). A change to either default or to the estimate would give the two servers different files again. Pinning `max_block_size` alone does nothing, because the bytes-based correction still applies. Generate fixed 50000-row blocks with `preferred_block_size_bytes = 0`. The file is now the 20 row groups of 50000 rows that `output_format_parquet_row_group_size = 50000` asks for, and its md5 is the same for every `max_threads`, `max_block_size`, `preferred_block_size_bytes` and `max_insert_threads` value tried. Query 5 still skips every row group by its bloom filter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| <!-- The generator runs as one stream of fixed 50000-row blocks (one per row group), so both servers write | ||
| byte-identical files; otherwise Q19's work depends on bloom filter false positives in each server's copy. --> | ||
| <fill_query><![CDATA[ | ||
| INSERT INTO FUNCTION file('test_clickbench_hits.parquet', Parquet) |
There was a problem hiding this comment.
tests/performance/scripts/perf.py:887 still executes every <fill_query> independently on each connection, so this benchmark still materializes one Parquet file with the PR binary and another with master. Pinning max_threads and the source block size removes the current scheduler/block-size noise, but it still does not make the compared fixtures identical when a PR changes generateRandom or Parquet serialization itself: Q19 can then compare different row-group / bloom-filter contents again for the same reason as before.
If the invariant here is really “the same fixture on both perf servers”, the file has to be generated once and reused on both sides (or copied from one side to the other) instead of letting each build run INSERT INTO FUNCTION file(...) separately.
Related: #125105
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
clickbench_parquet_shortperformance test now writes the same fixture file on both compared servers.Description
clickbench_parquet_shortquery 5 (WHERE UserID = 435090932899640449) is reported slower or faster on PRs that do not touch Parquet, e.g. #125105 (3.8 ms -> 5.1 ms).Each perf server writes its own copy of the fixture. With the profile's
max_threads = 12,generateRandom(...) LIMIT 1000000runs 12 parallel streams and keeps whichever blocks arrive first, so the two copies differ. Since #120907 this query is answered from the bloom filters of the 16 row groups alone. When one copy has a bloom filter false positive for the constant, that server reads and decodes oneUserIDdictionary page on every run. All five results with a difference above 20% since 2026-10-11 show it: 33 decoding tasks instead of 32 on the slow side.The generator now runs in a subquery as one stream of fixed 50000-row blocks (
max_threads = 1, max_block_size = 50000, preferred_block_size_bytes = 0), so the file depends neither on thread scheduling nor on block-size defaults; its 20 row groups are the 50000 rowsoutput_format_parquet_row_group_sizeasks for (was 16 of 66180). The outerINSERTkeeps the parallel Parquet encoding. The queries are unchanged, so their history and thresholds stay. SiblinggenerateRandomfixtures (parquet_read,parquet_read_with_index,orc_tuple_field_prune) only feed unfiltered scans and stay as they are.Validation with official master 26.10.1.2232: the old fill wrote a different file on each of 6 fills. The new one writes one file at
max_threads1-64 and withmax_block_size,preferred_block_size_bytesandmax_insert_threadsvaried, also on two concurrently filled servers. The fill takes about 1.3 s per server instead of 0.8 s; query 5 is still answered from the bloom filters alone (~4 ms). On two servers, a copy with the false positive ran query 5 6-28% slower than a clean copy (median of 200 runs, both server orders); identical copies were within 1%.Workflow [PR]
Sync PR [sync-upstream/pr/125513]
Version info
26.10.1.2301-master(included in26.10and later)