Skip to content

Commit f6c70b8

Browse files
committed
Fix out-dated comment in preprocess_groupclause()
The comment claimed we don't consider other orders of the GROUP BY clause, but this is no longer true as of db0d67d. Discussion: https://postgr.es/m/CAApHDvq65=9Ro+hLX1i9ugWEiNDvHrBibAO7ARcTnf38_JE+UQ@mail.gmail.com Backpatch-through: 15, where db0d67d was introduced.
1 parent 7fbf9b1 commit f6c70b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,8 +2756,9 @@ remove_useless_groupby_columns(PlannerInfo *root)
27562756
*
27572757
* In principle it might be interesting to consider other orderings of the
27582758
* GROUP BY elements, which could match the sort ordering of other
2759-
* possible plans (eg an indexscan) and thereby reduce cost. We don't
2760-
* bother with that, though. Hashed grouping will frequently win anyway.
2759+
* possible plans (eg an indexscan) and thereby reduce cost. However, we
2760+
* don't yet have sufficient information to do that here, so that's left until
2761+
* later in planning. See get_useful_group_keys_orderings().
27612762
*
27622763
* Note: we need no comparable processing of the distinctClause because
27632764
* the parser already enforced that that matches ORDER BY.

0 commit comments

Comments
 (0)