Skip to content

Don't use Finalize GroupAggregate if the input is not sorted - #10359

Draft
akuzm wants to merge 1 commit into
timescale:mainfrom
akuzm:sort-group
Draft

Don't use Finalize GroupAggregate if the input is not sorted#10359
akuzm wants to merge 1 commit into
timescale:mainfrom
akuzm:sort-group

Conversation

@akuzm

@akuzm akuzm commented Jul 29, 2026

Copy link
Copy Markdown
Member

When we have to re-sort all input, it's inferior to hash aggregation, so don't use it.

Also try hash-based partial aggregates before we try group-based ones. If they have same cost and pathkeys, only the first one survives. The hash aggregation can be disabled with a GUC and group aggregation cannot, so this makes the plan tuning more flexible.

When we have to re-sort all input, it's inferior to hash aggregation, so
don't use it.

Also try hash-based partial aggregates before we try group-based ones.
If they have same cost and pathkeys, only the first one survives. The
hash aggregation can be disabled with a GUC and group aggregation
cannot, so this makes the plan tuning more flexible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant