sql: add optimizer_use_limit_ordering_for_streaming_group_by session setting#94672
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Jan 5, 2023
Conversation
Member
DrewKimball
approved these changes
Jan 3, 2023
Collaborator
DrewKimball
left a comment
There was a problem hiding this comment.
Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @rharding6373)
mgartner
reviewed
Jan 4, 2023
| groupingCols opt.ColSet, | ||
| newOrdering props.OrderingChoice, | ||
| ) { | ||
| if !c.e.evalCtx.SessionData().OptimizerUseLimitOrderingForStreamingGroupBy { |
Contributor
There was a problem hiding this comment.
nit: add an xform test with this setting disabled and an expect-not to verify this works
rharding6373
approved these changes
Jan 4, 2023
Collaborator
rharding6373
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 2 of 0 LGTMs obtained (waiting on @msirek)
…setting Fixes cockroachdb#93410 This commit adds the `optimizer_use_limit_ordering_for_streaming_group_by` session setting that defaults to `true`. When `true`, an exploration rule which uses the ordering specified in a `SELECT ... GROUP BY ... ORDER BY ... LIMIT n;` statement as an interesting ordering to require from the input to the group-by expression, possibly eliminating a top-k operation. When `false`, the exploration rule is disabled. Release note: None
905b302 to
63d9aed
Compare
msirek
commented
Jan 5, 2023
Contributor
Author
msirek
left a comment
There was a problem hiding this comment.
TFTRs!
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @DrewKimball and @mgartner)
pkg/sql/opt/xform/groupby_funcs.go line 231 at r1 (raw file):
Previously, mgartner (Marcus Gartner) wrote…
nit: add an xform test with this setting disabled and an
expect-notto verify this works
Done
Contributor
|
Build succeeded: |
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.
Fixes #93410
This commit adds the
optimizer_use_limit_ordering_for_streaming_group_bysession setting that defaults totrue. Whentrue, an exploration rule which uses the ordering specified in aSELECT ... GROUP BY ... ORDER BY ... LIMIT n;statement as an interesting ordering to require from the input to the group-by expression, possibly eliminating a top-k operation. Whenfalse, the exploration rule is disabled.Release note: None