Repository navigation
Make the datetime_comparison performance test run its comparisons again - #126306
alexey-milovidov merged 1 commit into
Conversation
Every query of tests/performance/datetime_comparison.xml filters on materialize(<constant>) <cmp> <constant>. Since ClickHouse#105987 the planner folds such a filter to a constant (FunctionExecute 30578 -> 0 on master for all 8 queries), and since ClickHouse#124056 the always-true filter step is dropped, so each query was just count() FROM numbers(1000000000). On arm the speed of that one loop varies by up to ~15% between server starts of a build, which made the test report confirmed regressions on unrelated PRs, and it no longer measured the DateTime/DateTime64 comparisons it exists for (issue ClickHouse#28192). identity() is not constant-folded, so materialize(identity(X)) keeps the comparison per row with the pre-ClickHouse#105987 plan plus one identity call per block. identity goes inside materialize so the comparison is not JIT-compiled when JIT is enabled. 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 findings), plus my own review (0 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261016-143100 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261016-141600 |
|
cc @egor-click, could you review this and add |
|
Workflow [PR], commit [6bb1e2f] Summary: ✅
AI ReviewSummaryRestores all eight queries in Final VerdictStatus: ✅ Approve |
9e5a81a
Related: #105987
Related: #124056
Related: #28192
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Every query of
tests/performance/datetime_comparison.xmlhas the formWHERE materialize(<constant>) <cmp> <constant>. Since #105987 the planner folds such a filter to a constant, so no comparison runs (FunctionExecuteon master went from 30578 to 0 for all 8 queries). Since #124056 the always-true filter step is dropped as well, so each query is nowSELECT count() FROM numbers(1000000000).On arm the speed of that single loop varies by up to ~15% between server starts of one build, so
Performance Comparison (arm_release, master_head, 5/6)reports it as a confirmed regression: on #126219 (+17%, again after the confirmation restart) and on two other PRs the same day (1, 2). One side was more than 10% slower in 1.0-1.6% of this test's arm results while it still ran the comparison, and in 4.5-15.1% since #124056.The change wraps each constant in
identity, which is never constant-folded:materialize(identity(X)). The comparison runs for every row again, with the query plan from before #105987 plus oneidentitycall per block.identitygoes insidematerializeso that the comparison is not JIT-compiled when JIT is enabled (the harness disables it).Validation on the official amd_release build of master
d27018402fae: before the change, noFilterstep,FunctionExecute0 and 0.153-0.156 s for all 8 queries; after it, aFilterstep withgreater/equals,FilterTransformPassedRows1e9 and 0.30-0.42 s, slowest for DateTime64/Decimal64/UInt64. On the build just before #105987, the new queries take the same time as the old ones (within 4%).🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126306]
Version info
26.11.1.101-master(included in26.11and later)