Repository navigation
Enable optimize_move_to_prewhere_if_final by default - #121350
Conversation
|
Workflow [PR], commit [f434783] Summary: ✅
AI ReviewSummaryThis PR flips Final Verdict
LLVM Coverage ReportMeasured on commit f434783.
Changed lines: Changed C/C++ lines covered: 37/37 (100.00%) · Uncovered code |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units9 translation units recompiled, 31 s compile time in total, 9 of them have a recent master baseline. |
…-final' into yarik/enable-move-to-prewhere-if-final
|
Required: #121782 |
|
@yariks5s there is an interesting finding (by an agent) in clickhouse-test itself: and this PR flips this flag - and apparently no bugs are observed - seems like a stale workaround - probably it's worth to revert it in this PR... |
| CREATE TABLE t_prewhere_final_float (a UInt64, f Float64, v UInt64) ENGINE = ReplacingMergeTree(v) ORDER BY (a, f); | ||
|
|
||
| INSERT INTO t_prewhere_final_float VALUES (1, 0.0, 1); | ||
| INSERT INTO t_prewhere_final_float VALUES (1, -0.0, 2); | ||
|
|
||
| SELECT count() FROM (EXPLAIN actions=1 SELECT * FROM t_prewhere_final_float FINAL WHERE toString(f) = '0') WHERE explain LIKE '%Prewhere filter%'; | ||
| SELECT a, f, v FROM t_prewhere_final_float FINAL WHERE toString(f) = '-0'; |
There was a problem hiding this comment.
an agent detected that toString(f) = '-0' returns 1 -0 2 in any case (checked on 26.10.1.551), recommendation is to flip it to the direction that fails WHERE toString(f) = '0' - must return nothing and returns 1 0 1 when the guard is missing (though SELECT count() should catch a regression)
also it would be good to bring here tests for NaN payloads, Nullable(Float64), Tuple(Float64, UInt8) and Array(Tuple(Float64, UInt8)), and the mixed-key control from #122142 - it is closed in favor of this PR
Related: #109538
Related: #109703
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Setting
optimize_move_to_prewhere_if_finalis now enabled by default, so queries withFINALbenefit from the automaticPREWHEREoptimization. Only deterministic conditions over the sorting key are moved, and query results are not affected.Workflow [PR]
Sync PR [sync-upstream/pr/121350]
Version info
26.10.1.702-master(included in26.10and later)