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

Commit7defc3b

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 parentc32e05b commit7defc3b

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
@@ -3714,11 +3714,11 @@ create_grouping_paths(PlannerInfo *root,
37143714
&total_groups);
37153715

37163716
/*
3717-
* Gatheris always unsorted,sowe'll need to sort, unless
3718-
* there's no GROUP BY clause, in which case there will only be a
3719-
* single group.
3717+
*SinceGather's outputis always unsorted, we'll need to sort,
3718+
*unlessthere's no GROUP BY clause or a degenerate (constant)
3719+
*one, in which case there will only be asingle group.
37203720
*/
3721-
if (parse->groupClause)
3721+
if (root->group_pathkeys)
37223722
path= (Path*)create_sort_path(root,
37233723
grouped_rel,
37243724
path,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp