Repository navigation
optimizer: propagate sort keys through ValuesOp - #7559
Merged
Merged
Conversation
mattnibs
force-pushed
the
values-sort-keys
branch
from
October 29, 2026 21:32
fcb0ba0 to
2918c4b
Compare
mccanne
approved these changes
Oct 30, 2026
mattnibs
force-pushed
the
values-sort-keys
branch
2 times, most recently
from
October 30, 2026 16:53
df61164 to
4866460
Compare
analyzeSortKeys had no case for ValuesOp, so any values operator made the sort order unknown even when it passed the sort key through unchanged. This blocked lifting values (and everything downstream of it) into parallel paths ahead of a merge, e.g., the values operator generated by every SQL SELECT. A values operator with a single record expression without spreads is now flattened into the equivalent cut assignments and analyzed the same way as cut (analyzeCuts is renamed analyzeAssignments to reflect this). ValuesOp is also added to the set of operators liftIntoParPaths may copy into parallel paths.
mattnibs
force-pushed
the
values-sort-keys
branch
from
October 30, 2026 16:54
4866460 to
3e1a390
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
analyzeSortKeys had no case for ValuesOp, so any values operator made the sort order unknown even when it passed the sort key through unchanged. This blocked lifting values (and everything downstream of it) into parallel paths ahead of a merge, e.g., the values operator generated by every SQL SELECT.
A values operator with a single record expression without spreads is now flattened into the equivalent cut assignments and analyzed the same way as cut (analyzeCuts is renamed analyzeAssignments to reflect this). ValuesOp is also added to the set of operators liftIntoParPaths may copy into parallel paths.