Skip to content

Run the adaptive_aggregation_heavy_payload performance queries above 1 s on hits_10m_single - #129655

Open
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-adaptive-aggregation-heavy-payload-10m
Open

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-adaptive-aggregation-heavy-payload-10m

Conversation

@groeneai

@groeneai groeneai commented Nov 6, 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 (queries over 1 s). Four hits_100m_single queries of adaptive_aggregation_heavy_payload take 3912 / 4373 / 3196 / 1495 ms on amd MasterCI and 2220 / 2851 / 2233 / 966 ms on arm (#0-#3, 14-day medians). The whole file takes 243 s per amd job and 172 s per arm job.

The four get disabled="1", and the file's five hits_100m_single queries are appended on hits_10m_single, otherwise verbatim: the four plus the light-argument control #4, so the control still shares a scan with the payload shapes. No existing query number or text changes: 4 queries are disabled and 5 are appended (#6-#10). #4 and #5 keep running.

The new queries take the same aggregation paths as their originals do on CI. On one official master build, at 8 and at 12 threads, the WatchID queries still freeze every thread's table and stage nearly all rows without a thaw, and the URL and UserID queries are still found repeat-dominated by their prewarm run and then take the ordinary path (AdaptiveAggregation* and AggregationPreallocatedElementsInHashTables profile events, compared with CI's).

In a local perf.py A/B the new queries take 0.09 / 0.10 / 0.14 / 0.11 of the old time, which projects to about 358 / 444 / 458 / 168 ms on amd and 203 / 290 / 320 / 108 ms on arm. A local run of the whole file took 48-57 s instead of 231-243 s. The appended queries start without history, so CI judges them at the compare.sh floors (0.15 / 0.25), below the thresholds #0-#2 had learned (0.45-0.61).

Validation: perf.py --print-queries lists the 6 master queries unchanged, then the 5 new ones; the local runs of the new file measured only #4-#10 and never sent #0-#3 to a server.

🤖 Generated with Claude Code


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

…ingle

The four hits_100m_single queries of the test take 1.5-4.4 s each on CI
(14-day MasterCI medians, amd). Disable them with the `disabled` marker and
append the five hits queries of the file on hits_10m_single, the
light-argument control included so that it shares a scan with the payload
shapes. No existing query number or text changes: 4 queries are disabled
and 5 are appended (ClickHouse#6-ClickHouse#10).

Related: ClickHouse#129258

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

groeneai commented Nov 6, 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; 1 finding).

# Sev Finding Verdict Evidence / action
1 ⚠️ The 10M queries have no in-file proof that they keep the adaptive-aggregation paths (adaptive_aggregation_heavy_payload.xml:22-26) DISAGREE Recorded system.query_log ProfileEvents at max_threads 8 and 12 put each new query in its original's class (WatchID: freeze, 9.8M of 10M rows staged, no thaw; URL / UserID: thaw in the prewarm run, then the ordinary path), matching CI's counters for the originals. CI records these events for every run, so they can be checked after the merge.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261106-002600

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? The cost is measured, not sporadic: 14-day MasterCI medians of #0-#3 are 1.5-4.4 s amd, and every local A/B pass on the old file reproduces it (#0-#3 at 1.4-4.5 s, the whole file at 231-243 s).
b Root cause explained? #0-#3 read the 100M-row hits_100m_single (10-12 GB hash tables for #0-#2), but the aggregation paths they measure already behave the same on the 10M-row hits_10m_single.
c Fix matches root cause? Same texts on the 10x smaller table that CI already loads for 54 perf files; the old queries are disabled, not edited; no setting or framework change.
d Test intent preserved / new tests added? All five hits shapes, the light-argument control included, still run in their originals' aggregation paths at 8 and 12 threads (AdaptiveAggregation* / preallocation profile events vs CI's); #4 and #5 keep their numbers. The file is the test.
e Both directions demonstrated? Old file: #0-#5 measured at their CI cost. New file: only #4-#10 measured, #6-#9 at 0.17-0.48 s locally, and #0-#3 never sent to a server (3 + 3 alternating passes).
f Fix is general across code paths? N/A (test-only). Every hits_100m_single query of the file that is over 1 s moves; #4 (0.8 s) and #5 stay.
g Fix generalizes across inputs (params/datatypes/wrappers)? Checked at both CI thread counts (8 amd, 12 arm); UInt64 and String keys, String / DateTime arguments as before.
h Backward compatible? (maintainer-approved exception only) Yes: no setting, product code or perf.py change; existing query numbers and history unchanged, new numbers are fresh (this test never had an index above 5).
i Invariants and contracts preserved? #0-#5 byte-identical in place, new queries only appended, no disabled query in any prewarm or run, and all 7 enabled queries fit --max-queries 10.

Session id: cron:clickhouse-impl-slot-4:20261106-001900

@groeneai

groeneai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this and add the can be tested label so CI runs? Following the disabled approach from #129366: the four hits_100m_single queries over 1 s are disabled, and the five hits_100m_single queries of the file are appended verbatim on hits_10m_single (projected 0.17-0.46 s on amd), with no existing query number or text changed. The queries were picked by time, as in #129627 and #129628, so your question there applies here too: if you would rather keep the long versions until the coverage-based selection has results, I will leave this PR as it is.

@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a31c5e7]

Summary: ✅


AI Review

Summary

PR #129655, reviewed at a31c5e7d6f47233706bcea2a7d8d337cb64c6974, disables four expensive hits_100m_single benchmark queries and appends five corresponding hits_10m_single queries, including the control. Existing query texts and history indices are preserved. No actionable findings; the reported before/after timings and aggregation-path measurements support this test-only change.

Missing context / blind spots
  • ⚠️ Runtime measurements were not independently reproduced. XML validation passed, but running perf.py --print-queries stopped because clickhouse_driver is unavailable; this checkout also has no ClickHouse build. The current performance CI reports contain no executed tests. A targeted CI run on amd and arm would independently confirm the author's reported timings and profile events at 8 and 12 threads.
Final Verdict

Status: ✅ Approve. No changes requested and no new inline findings to post.

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 6, 2026
@clickhouse-gh clickhouse-gh Bot added comp-aggregation GROUP BY / aggregation framework (hash tables, spilling, external aggregation). and removed comp-testing Test content only (no production code). labels Nov 19, 2026

This branch has not been deployed

No deployments
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-aggregation GROUP BY / aggregation framework (hash tables, spilling, external aggregation). pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant