Repository navigation
Introduce WindowTransformParams - #122762
Conversation
…ow_functions_model_params
|
Workflow [PR], commit [f11edc2] Summary: ✅
AI ReviewSummaryThis PR extracts window-frame setup, Missing context / blind spots
Final Verdict✅ No new findings. LLVM Coverage ReportMeasured on commit f11edc2.
Changed lines: Changed C/C++ lines covered: 232/237 (97.89%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes15 object files changed (+72.55 KiB total), 1 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units20 translation units recompiled, 44 s compile time in total, 19 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR only restructures window-function execution: it moves the WindowTransform setup into a new WindowTransformParams and replaces a std::function with a plain function pointer for the RANGE OFFSET comparator. No query in clickbench or tpch_adapted_1_official uses window functions. The two flagged improvements, clickbench Q31 (-11.5%) and Q34 (-11.0%), are plain GROUP BY aggregations that never reach the changed code. Both are downgraded to not sure: the PR medians fall inside master's current-era range, and the baseline had only 5 runs after a recent master shift, so no performance change can be attributed to this PR. clickbenchFlagged queries (2 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
…Params peer check Master's window refactor (ClickHouse#122762, ClickHouse#123260, ClickHouse#123737) moved the peer comparison into WindowTransformParams::arePeers and added SlidingIndexes, which marks peer-group starts for every RANGE and GROUPS frame with raw compareAt / getEqualRangeEndAssumeSorted. The input is sorted with the ORDER BY collator, so collation-equal values that differ in bytes (for example 'a' and 'A' under 'en-u-ks-level2') are interleaved, and the raw scan either cuts a peer group short or trips the debug check "Equal values are not contiguous within the range assumed to be sorted". Since ClickHouse#123737 this aborts deterministically for an ordinary collated rank(): SELECT rank() OVER (ORDER BY x COLLATE 'en-u-ks-level2') FROM (SELECT if(number % 2, 'a', 'A') AS x FROM numbers(1000)) The previous version of this fix lived in WindowTransform methods that the refactor removed, so it is re-done on the new structure. WindowTransformParams gets the collation flag and two helpers, haveEqualOrderByValues and getOrderByEqualRangeEnd, and every ORDER BY peer comparison goes through them: arePeers (cume_dist and the GROUPS cross-block check), the SlidingIndexes block boundary and in-block scan, the RANGE frame-end check and scan, and the GROUPS peer-group scan. PARTITION BY keys stay raw, as PARTITION BY cannot carry COLLATE. The helpers are inline in the header with the collated comparison in out-of-line cold functions, so an uncollated window keeps the inlined raw comparison of master: the earlier out-of-line version of these calls cost 15-19% on window_function_with_order in the arm performance check. The test gains the deterministic 1000-row case above (also for GROUPS), a cume_dist case and a one-row-per-block rank() case, so each of the six comparison sites has an assertion that fails when only that site compares raw. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch introduces
WindowTransformParams, similar toAggregatingTransformParams, to reduce code complexity in theWindowTransform.Workflow [PR]
Sync PR [sync-upstream/pr/122762]
Version info
26.10.1.1049-master(included in26.10and later)