Skip to content

Propagate consider_startup flag to compressed chunk table - #9738

Merged
akuzm merged 6 commits into
timescale:mainfrom
akuzm:consider-compressed
May 13, 2026
Merged

Propagate consider_startup flag to compressed chunk table#9738
akuzm merged 6 commits into
timescale:mainfrom
akuzm:consider-compressed

Conversation

@akuzm

@akuzm akuzm commented May 8, 2026

Copy link
Copy Markdown
Member

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

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

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@akuzm
akuzm marked this pull request as ready for review May 8, 2026 12:34
@akuzm
akuzm requested a review from a team May 8, 2026 12:34
@github-actions
github-actions Bot requested review from Poroma-Banerjee and dbeck May 8, 2026 12:34
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

@Poroma-Banerjee, @dbeck: please review this pull request.

Powered by pull-review

*
* First, check if this query is candidate for SELECT DISTINCT SkipScan.
*/
const bool potential_select_distinct = list_length(root->distinct_pathkeys) == 1;

@natalya-aksman natalya-aksman May 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@akuzm
akuzm enabled auto-merge (squash) May 13, 2026 13:15
@akuzm
akuzm merged commit d343ca5 into timescale:main May 13, 2026
63 of 66 checks passed
@akuzm
akuzm deleted the consider-compressed branch May 13, 2026 13:15
@timescale-automation timescale-automation added the released-2.28.0 Released in 2.28.0 label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released-2.28.0 Released in 2.28.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants