Repository navigation
Revert WindowTransform changes of #123808 - #124640
Conversation
Restores `WindowTransform` and `SlidingIndexes` to their state before #123808: the `SortedKeyRuns` peer-run cache in `findPeerRunEnd` and the stateful run search in `markKeyChangesInRange` are removed, and the window queries are dropped from the `sorted_key_prefix_runs` performance test. The other users of `SortedKeyRuns` added by that pull request are kept. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Workflow [PR], commit [90f713b] Summary: ✅
AI ReviewSummaryThis PR cleanly reverts the Findings
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit 90f713b.
Changed lines: Changed C/C++ lines covered: 29/29 (100.00%) · Uncovered code |
| // so the scan will just return the end of the block. | ||
| const Int64 peer_group_end_row = findPeerRunEnd(frame_end.block, frame_end.row, rows_end); | ||
| const Int64 peer_group_end_row | ||
| = getEqualRangeEndAssumeSorted(blocks.blockAt(frame_end.block).materialized_columns, params.order_by_indices, frame_end.row, rows_end, 1 /* nan_direction_hint */); |
There was a problem hiding this comment.
#123808's findPeerRunEnd/SortedKeyRuns reuse was the part that stopped window scans from re-searching the same long leading-key run for every short peer group inside it. Switching this call site back to the stateless getEqualRangeEndAssumeSorted path reintroduces that sorted-prefix slowdown for OVER (ORDER BY a, b) workloads, and the same regression is reintroduced again in src/Processors/Transforms/Window/SlidingIndexes.cpp for peer-group and PARTITION BY boundary discovery. If the ongoing WindowTransform refactor cannot keep the helper verbatim, please preserve the prefix-run reuse here (or land an equivalent replacement in the same PR) instead of merging the regression.
| <query>SELECT sum(x) OVER (ORDER BY a, b) FROM sorted_key_prefix_runs FORMAT Null</query> | ||
| <query>SELECT count() OVER (ORDER BY a, b GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM sorted_key_prefix_runs FORMAT Null</query> | ||
| <query>SELECT row_number() OVER (PARTITION BY a, b ORDER BY x) FROM sorted_key_prefix_runs FORMAT Null SETTINGS max_threads = 1</query> |
There was a problem hiding this comment.
Please keep these benchmarks. They are the only in-tree tests/performance cases that exercise the three window paths slowed down by this revert: OVER (ORDER BY a, b), GROUPS, and PARTITION BY a, b ORDER BY x. Dropping them at the same time as the code change means a pr-performance run can no longer quantify whether the follow-up rework restores the lost behavior, so the regression disappears from CI instead of staying measurable.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes14 object files changed (+53.09 KiB total), 0 added.
719 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 units8 translation units recompiled, 13 s compile time in total, 8 of them have a recent master baseline. |
Take the multi-column sorted key run reuse for LIMIT BY, negative LIMIT BY, DISTINCT in order, full_sorting_merge and partial_merge JOIN. Skip the WindowTransform changes (reverted on master by #124640) and the ReplacingSortedAlgorithm run skipping (needs the batch sorting queue, absent in 26.8). Fixes the LIMIT BY regression from #106502 reported in #123700
Take the multi-column sorted key run reuse for LIMIT BY, negative LIMIT BY, DISTINCT in order, full_sorting_merge and partial_merge JOIN. Skip the WindowTransform changes (reverted on master by #124640) and the ReplacingSortedAlgorithm run skipping (needs the batch sorting queue, absent in 26.9). Fixes the LIMIT BY regression from #106502 reported in #123700
- Resolve the `TODO: wait for the revert-of-revert.` on #123808: #124640 reverted only its `WindowTransform` part and no re-apply is planned, so the window functions are dropped from the entry instead. - Sort every category by significance, clustering related entries. - Move 21 entries between categories (efficiency entries to `Performance Improvement`, user-visible failures to `Bug Fix`, usability changes out of `Bug Fix`, new SQL surface to `New Feature`). - Merge 28 groups of entries describing the same feature or fix, including regressions of this release folded into the feature they broke. - Rewrite entries that described internal classes instead of the user-visible effect, and fix backticks and formatting. - Drop two pure CI/test-build entries from `Build/Testing/Packaging Improvement` (#123180, #125593). Related: #120500 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):
I am reworking the
WindowTransformstate right now. Let's not complicate it with additional changes.Workflow [PR]
Sync PR [sync-upstream/pr/124640]
Version info
26.10.1.1908-master(included in26.10and later)