Propagate consider_startup flag to compressed chunk table - #9738
Merged
Conversation
It seems at the moment it's just not set, which might lead to suboptimal plan choice. We also have an heuristic to trigger it for queries that might need SkipScan, so move this to happen earlier.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@Poroma-Banerjee, @dbeck: please review this pull request.
|
| * | ||
| * First, check if this query is candidate for SELECT DISTINCT SkipScan. | ||
| */ | ||
| const bool potential_select_distinct = list_length(root->distinct_pathkeys) == 1; |
Member
There was a problem hiding this comment.
I meant to fix this at some time and now it's a good time. We now allow multicolumn SkipScan for DISTINCT for nonnullable distinct outputs. Let's change the above to:
const bool potential_select_distinct = list_length(root->distinct_pathkeys) >= 1;
For DISTINCT aggregates below we still allow only one distinct aggregate for SkipScan so below code is correct.
natalya-aksman
approved these changes
May 8, 2026
Poroma-Banerjee
approved these changes
May 8, 2026
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.
It seems at the moment it's just not set, which might lead to suboptimal plan choice.
We also have an heuristic to trigger it for queries that might need SkipScan, so move this to happen earlier. Also update it to work for multicolumn DISTINCT.
The flag propagation itself doesn't influence anything at the moment, because the Index paths are still kept based on pathkeys. But logically it's more correct.
Disable-check: force-changelog-file