Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1b449b

Browse files
committed
Fix partial aggregation for the case of a degenerate GROUP BY clause.
The plan generated for sorted partial aggregation with "GROUP BY constant"included a Sort node with no sort keys, which the executor does not like.Per report from Steve Randall. I'd add a regression test case if I couldthink of a compact one, but it doesn't seem worth expending lots of cycleson.Report: <CABVd52UAdGXpg_rCk46egpNKYdXOzCjuJ1zG26E2xBe_8bj+Fg@mail.gmail.com>
1 parent0b1b503 commite1b449b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/optimizer/plan/planner.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3741,11 +3741,11 @@ create_grouping_paths(PlannerInfo *root,
37413741
&total_groups);
37423742

37433743
/*
3744-
* Gatheris always unsorted,sowe'll need to sort, unless
3745-
* there's no GROUP BY clause, in which case there will only be a
3746-
* single group.
3744+
*SinceGather's outputis always unsorted, we'll need to sort,
3745+
*unlessthere's no GROUP BY clause or a degenerate (constant)
3746+
*one, in which case there will only be asingle group.
37473747
*/
3748-
if (parse->groupClause)
3748+
if (root->group_pathkeys)
37493749
path= (Path*)create_sort_path(root,
37503750
grouped_rel,
37513751
path,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp