Skip to content

Remove performance test queries that are also measured in another file - #129303

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-tests-remove-cross-file-duplicate-queries
Nov 4, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-tests-remove-cross-file-duplicate-queries

Conversation

@groeneai

@groeneai groeneai commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129258

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Item 4 of #129258: queries measured with the same text, settings and tables in two files outside the tpch*/tpcds*/iceberg_suite_* suites. I removed one copy of each:

The 14-day master medians of each pair are equal within 3% per arch. Kept as different paths: parse_engine_file #3 / tsv_csv_nullable_parsing #1 (different tables), string_sort #10 / top_k_dynamic_filtering_single_string_column #2 (use_query_condition_cache = 1), text_index #31-33 / text_index_phrase_blocked #4-6 (different indexes and settings).

Later queries move down: external_distinct_tail_spill #1, #4, #5 to #0-2, if_transform_strings_to_enum #2, #3 to #0, #1, cpu_synthetic #26-39 to #25-38, prefetch_in_aggregation #6-13 to #4-11, uniq_up_to_saturated_hash #1 to #0. All their learned thresholds are below the report's floors (0.15 / 0.25), so their effective thresholds stay the same.

This saves about 50 s per arch per master commit: the whole date_time_short file, and the removed queries of the three small files that run all their queries. The other three files sample 10 queries anyway. A remaining copy in a file with more than 10 queries (for example the 15 date_time queries and uniqUpTo(5)(SearchPhrase)) runs on master when that file's random 10 picks it; nightly runs every query.

Validated with perf.py --print-queries on all files before and after: besides the removed queries and the moved one, every expanded query is byte-identical.


Workflow [PR]
Sync PR [sync-upstream/pr/129303]

Version info

  • Merged into: 26.11.1.1365-master (included in 26.11 and later)

Each removed query has the same text, settings and tables as a query in
another file, so it measured the same path a second time.

- date_time_short.xml: deleted. 15 of its 16 queries are date_time_long
  ClickHouse#49, 76, 94, 131, 141, 144, 106, 146, 148, 152, 160, 170, 171, 109, 121.
  Its only other query, toUnixTimestamp(toUInt16(t)), is appended to
  date_time_long as ClickHouse#172 (no other index of date_time_long moves).
- external_distinct_tail_spill #0, ClickHouse#2, ClickHouse#3: same as
  external_distinct_coalescing #0, external_distinct_spill_blocks ClickHouse#1 and
  external_distinct_limit_remerge #0. ClickHouse#1, ClickHouse#4, ClickHouse#5 become #0, ClickHouse#1, ClickHouse#2; the
  header comment no longer mentions ordered output.
- if_transform_strings_to_enum #0, ClickHouse#1 (without the setting): same as
  group_by_no_aggregates_string_keys #0, ClickHouse#1. ClickHouse#2, ClickHouse#3 become #0, ClickHouse#1.
- cpu_synthetic ClickHouse#25 (cutQueryString(URL) on hits_100m_single): same as
  url_hits ClickHouse#20. ClickHouse#26-ClickHouse#39 become ClickHouse#25-ClickHouse#38.
- hash_table_sizes_stats ClickHouse#13 (min(MobilePhoneModel)): same as
  agg_functions_min_max_any ClickHouse#16. It was the last query, nothing moves.
- prefetch_in_aggregation ClickHouse#4, ClickHouse#5 (numbers/numbers_mt(10000000) GROUP BY
  number): same as hash_table_sizes_stats ClickHouse#1, ClickHouse#3. The template is pinned to
  50000000; ClickHouse#6-ClickHouse#13 become ClickHouse#4-ClickHouse#11.
- uniq_up_to_saturated_hash #0 (uniqUpTo(5)(SearchPhrase)): same as
  uniq_hits_no_key_other ClickHouse#48. ClickHouse#1 becomes #0.

max_size_to_preallocate_for_aggregation = 1e9 in hash_table_sizes_stats
does not make its copies a different path: it only matters above
1e9 / 16 groups per table, and these queries have at most 10M groups.

Kept as different paths: parse_engine_file ClickHouse#3 / tsv_csv_nullable_parsing ClickHouse#1
(different tables), string_sort ClickHouse#10 /
top_k_dynamic_filtering_single_string_column ClickHouse#2 (the latter sets
use_query_condition_cache = 1), text_index ClickHouse#31-ClickHouse#33 /
text_index_phrase_blocked ClickHouse#4-ClickHouse#6 (different text indexes and settings).

Related: ClickHouse#129258

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (5 nits, no blocker or major).

# Sev Finding Verdict Evidence / action
1 💡 PR description said the removed copy "needs no template rewrite", but the prefetch_in_aggregation template is pinned AGREE, fixed in the description wording only
2 💡 The sampling note named only the date_time and uniqUpTo copies AGREE, fixed in the description every surviving copy in a file with more than 10 queries runs when the random 10 pick it
3 💡 uniq_up_to_saturated_hash was a dedicated benchmark; its single-argument case now runs only in the sampled uniq_hits_no_key_other grid AGREE, noted same path, stated in the description

Checked and holding: every removed query text, file-level setting and table matches its surviving copy (allow_preliminary_distinct_abandoning defaults to 1; max_size_to_preallocate_for_aggregation = 1e9 is inert below 10M groups); 14-day per-arch master medians of each pair agree within 3%; the shifted indexes lose their history key (test, index, query text) and fall back to the 0.15 / 0.25 floors, which already decide them.

Session id: cron:clickhouse-review-slot-8:20261104-144900

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. perf.py --print-queries over every tests/performance file on master lists 30 query texts measured in two files outside the tpch*/tpcds*/iceberg_suite_* suites.
b Root cause explained? Copies accumulated: date_time_short was the per-commit subset of date_time_long while long was tagged long (untagged in 2021); external_distinct_tail_spill repeated 3 queries of its sibling files with identical settings; group_by_no_aggregates_string_keys was created from if_transform_strings_to_enum's baseline queries; 4 single repeats elsewhere.
c Fix matches root cause? Yes. Only the redundant copy is removed; no remaining query text, setting or table changes.
d Test intent preserved / new tests added? Every removed query is still measured, with the same settings and tables, in the other file. No new test: perf test definitions only.
e Both directions demonstrated? The before/after comparison of the expanded queries passes (only the removed and moved queries differ); comparing the base with itself fails it (9 FAIL), so the check can redden.
f Fix is general across code paths? The comparison covers all files incl. <include> expansion. Repeats inside one file are a separate PR; the suites are kept as asked on #129258.
g Fix generalizes across inputs (params/datatypes/wrappers)? Matching is whitespace-normalized and case-insensitive; the case-only pairs were checked (one removed, one kept: different tables). Three pairs are kept as different paths.
h Backward compatible? (maintainer-approved exception only) No setting or format. Shifted query indexes have learned thresholds below the report's floors, so their effective thresholds do not change.
i Invariants and contracts preserved? perf.py parses every resulting file; xmllint and the style check pass.

Session id: cron:clickhouse-impl-slot-41:20261104-144003

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this and add the can be tested label so CI runs? It removes one copy of each perf query that is measured with the same text, settings and tables in two files outside the TPC-H/TPC-DS/Iceberg suites (item 4 of #129258), mostly by deleting date_time_short, whose 15 of 16 queries are already in date_time_long.

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d038e8e]

Summary: ✅


AI Review

Summary

PR #129303, head d038e8e508fc0535bfb82b6e1a0a5c467341a606, removes duplicate performance-test queries and moves the unique date_time_short.xml case into date_time_long.xml. No actionable findings. Independent query-expansion validation confirms 268 → 243 queries across the changed files, with every unique query preserved. The reduced per-commit sampling frequency of some retained cases is explicitly disclosed; nightly coverage remains complete.

Final Verdict

Status: ✅ Approve. No required changes.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 4, 2026
@Algunenano Algunenano self-assigned this Nov 4, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label Nov 4, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 4, 2026
@Algunenano
Algunenano added this pull request to the merge queue Nov 4, 2026
Merged via the queue into ClickHouse:master with commit cdf882f Nov 4, 2026
366 of 367 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 4, 2026
Ergus pushed a commit to Ergus/ClickHouse that referenced this pull request Nov 11, 2026
Add separate instrumented shards to `NightlyCoverage`. Reuse `perf.py` to
collect setup, first execution, repeated execution, and teardown coverage,
with expanded-query hashes and snapshot manifests. Export source coverage
through the existing CIDB coverage pipeline; do not publish performance
measurements from instrumented runs.

Context:
ClickHouse#129176
ClickHouse#129303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants