Skip to content

Add a disabled attribute to performance test queries, and disable five verbatim duplicates - #129366

Merged
egor-click merged 3 commits into
ClickHouse:masterfrom
groeneai:perf-tests-remove-within-file-duplicate-queries
Nov 5, 2026
Merged

egor-click merged 3 commits into
ClickHouse:masterfrom
groeneai:perf-tests-remove-within-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

Part of the #129258 audit (duplicated queries), reworked after review: deleting the five duplicates moved 23 later queries to new numbers and restarted their history, so the duplicates are now disabled instead.

perf.py reads <query disabled="1">: a disabled query keeps its query number (its position in the expanded query list, which keys the performance history), and --print-queries still prints it, but it is never run (--queries-to-run refuses it) and does not take part in the setup: the CREATE/DROP statements of a disabled <query file=...> are skipped, a disabled shell query does not trigger the shell-query restrictions (also in profile-collection discovery), and a disabled write query does not keep merges running under --stop-merges. Documented in tests/performance/README.md.

The later copy of each duplicated <query> element is disabled:

Validation:

  • perf.py --print-queries output of the four files is byte-identical to master, so no query number moves.
  • Live perf.py runs on two local servers (official master build): hash_table_sizes_stats ran #0-3 and fix docs #6-12 (master perf.py: #0-12), joins_in_memory ran #0-25 and Chebotarev push test 2 #27 (master: #0-27), --max-queries 11 picked exactly the 11 enabled queries, and --queries-to-run 4 5 was refused before connecting. Synthetic tests: with a disabled INSERT, merges were stopped (master perf.py kept them running); a disabled file query's CREATE was not run, and a disabled shell query no longer conflicts with do_not_check_in_pr (master perf.py rejects the test).

🤖 Generated with Claude Code


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

Version info

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

Each of these queries was written twice in its own file, so it was
measured twice and reported as two queries:

- agg_functions_argmin_argmax: the argMinIf(Title, ...) query was
  present twice since the file was created.
- avg_weighted: avgWeighted(num_f, num_f) was repeated, column-aligned,
  as the first row of the toNullable matrix.
- hash_table_sizes_stats: two identical numbers_mt({numbers_threshold_value})
  templates, left when the four numbers_mt sizes were parameterized into
  two values. The hash table size statistics are keyed by the query plan,
  so both copies used one cache entry.
- joins_in_memory: the CROSS JOIN query was repeated with the tag
  'CROSS KEY'; tags are not used by the harness.

The later copy is removed, so the earlier one keeps its index and text.
The queries after it move up one index: 23 queries in total.

Related: ClickHouse#129258

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 the later copy of the five expanded queries that repeat verbatim in their own file (agg_functions_argmin_argmax, avg_weighted, hash_table_sizes_stats, joins_in_memory; item 1 of #129258), so each is measured once and the 23 queries after them move up one index.

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2cd27b0]

Summary: ✅


AI Review

Summary

Adds a disabled attribute to performance queries and disables five duplicate expansions while preserving query numbers and performance history. No actionable findings at head 2cd27b0b5dc4c59174a2b877388dd6cc54d9ee4e. Focused checks covered numbering, execution selection, sampling, file-specific setup, merge control and profile discovery using a mocked driver; live-server execution and timings were not independently repeated.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 4, 2026
@egor-click

Copy link
Copy Markdown
Contributor

@groeneai lets stop this task for a while, i will tell you when to resume if needed, cutting 1 second per PR and messing up query numbers does not worth it i think

let me try my experiments first, i will let you know the next steps later

@CLAassistant

CLAassistant commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 4, 2026
@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Understood. I've stopped the series and won't open the remaining #129258 items until you tell me to resume. I'll leave this PR open in case the duplicate removal is still wanted; feel free to close it otherwise.

@fm4v fm4v closed this Nov 4, 2026
@Algunenano

Copy link
Copy Markdown
Member

@egor-click I disagree. We must fix performance tests and they've been broken since forever. We have duplicated tests, slow tests, noisy tests, hard to understand thresholds that hide regressions.

@groeneai Please keep going. Ping me on new PRs and I'll review them

@egor-click

Copy link
Copy Markdown
Contributor

@Algunenano this will mess up history, i think we can do better than that

this is a solution made in a hurry and saving a couple of seconds and it doesn’t save us from anything

@egor-click

Copy link
Copy Markdown
Contributor

we have only test and query number for historical results, if we start deleting tests, all query numbers will change and all history we have will be thrown into trash

i don’t like that, @groeneai , this is a solution made in a hurry that will break more than it will improve

i think that we need a way to mark queries disabled,stale so they don't run and only append new queries or create new tests and never change or delete

@groeneai

groeneai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Understood. This PR moves 23 later queries up one number in the 4 files, so their history and learned thresholds would restart under the new numbers. I won't push to it (or open more in the series) until you and @ Algunenano agree on the approach. A disabled marker looks small in perf.py: the query number is its position in the expanded list, so a disabled <query> that keeps its slot but does not run leaves every other number unchanged, and this PR would then just mark the 5 copies disabled. I can send the marker as a separate PR if you want it.

@Algunenano

Copy link
Copy Markdown
Member

@groeneai Please add a disabled marker

groeneai and others added 2 commits November 5, 2026 14:00
…g them

The performance history is keyed by the test name and the query number,
which is the position of the query in the expanded query list. Deleting the
five duplicates moved 23 later queries of the same files to new numbers, so
their history and learned thresholds would restart.

perf.py now reads `<query disabled="1">`: a disabled query keeps its number,
and `--print-queries` still prints it, but it is not run in the default or
sampled set (an explicit `--queries-to-run` still runs it), and it does not
keep merges running under `--stop-merges`.

The five copies are restored and marked disabled, so every query number in
the four files is the same as on master.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checks

A disabled query is now inert everywhere: `--queries-to-run` with a disabled
index fails before connecting (`--print-queries` still prints it), the setup
statements of a disabled `<query file=...>` are not run, a disabled shell query
no longer rejects `--user`/`--secure` or `do_not_check_in_pr`, nor makes profile
collection skip the test, and the Iceberg configuration does not rewrite it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai changed the title Remove verbatim duplicate queries from four performance tests Add a disabled attribute to performance test queries, and disable five verbatim duplicates Nov 5, 2026
@groeneai

groeneai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Added in ce4ea29 and 2cd27b0: perf.py now reads <query disabled="1">. A disabled query keeps its number and still shows in --print-queries, but it is never run and takes no part in the setup (documented in tests/performance/README.md). This PR now marks the 5 copies disabled instead of deleting them, so no query number in the 4 files moves: the --print-queries output is identical to master. I kept the marker in this PR since this PR is its first user, so its own performance run shows the 5 copies skipped.

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Nov 5, 2026
@egor-click

Copy link
Copy Markdown
Contributor

thanks @groeneai and Raúl, @groeneai please follow up after this is merged in the rest of the PRs related to this task to follow this approach, feel free to ping me to review these and following PRs , this should override my request to pause this work

@groeneai

groeneai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. Once this merges, I'll rework the rest of the #129258 series to this approach (disable, never renumber or delete) and ping you for review. @ Algunenano asked to wait for your history rework before changing any performance test queries (#129399 (comment)), so I'll hold those PRs until it lands, unless you two tell me otherwise.

@egor-click

Copy link
Copy Markdown
Contributor

disable approach is a good workaround for now so this should be unblocked, i will work on better alternatives next week

@groeneai

groeneai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. Then I won't wait for the history rework: once this merges, I'll rework #129364, #129457 and the remaining #129258 items to this approach and ping you on each.

@egor-click
egor-click added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ClickHouse:master with commit 93b27ce Nov 5, 2026
185 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 5, 2026
@groeneai

groeneai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

One detail for the rest of the series: perf.py still runs a test's create_query/fill_query when its queries are disabled (only a disabled <query file=...> skips its own setup), and several of those PRs save their time in the fills. So where I replace queries, I'll mark the old ones disabled="1", append the new ones (or add a new test), and remove the create/fill of a table that only disabled queries read. No existing query's text or number changes. Tell me if you'd rather keep those fills.

@egor-click

Copy link
Copy Markdown
Contributor

yes, if the fill is not used i think it should be safe and correct to skip fills in case no queries use that data

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). manual approve Manual approve required to run CI 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.

6 participants