]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix out-dated comment in preprocess_groupclause()
authorDavid Rowley <drowley@postgresql.org>
Mon, 19 Sep 2022 21:15:04 +0000 (09:15 +1200)
committerDavid Rowley <drowley@postgresql.org>
Mon, 19 Sep 2022 21:15:04 +0000 (09:15 +1200)
The comment claimed we don't consider other orders of the GROUP BY clause,
but this is no longer true as of db0d67db2.

Discussion: https://postgr.es/m/CAApHDvq65=9Ro+hLX1i9ugWEiNDvHrBibAO7ARcTnf38_JE+UQ@mail.gmail.com
Backpatch-through: 15, where db0d67db2 was introduced.

src/backend/optimizer/plan/planner.c

index a0f2390334eb0aeb062232416f2b8991a82acda0..d8e8f607b2bc31c7619a9f0ecf7e20c37d41ced4 100644 (file)
@@ -2756,8 +2756,9 @@ remove_useless_groupby_columns(PlannerInfo *root)
  *
  * In principle it might be interesting to consider other orderings of the
  * GROUP BY elements, which could match the sort ordering of other
- * possible plans (eg an indexscan) and thereby reduce cost.  We don't
- * bother with that, though.  Hashed grouping will frequently win anyway.
+ * possible plans (eg an indexscan) and thereby reduce cost.  However, we
+ * don't yet have sufficient information to do that here, so that's left until
+ * later in planning.  See get_useful_group_keys_orderings().
  *
  * Note: we need no comparable processing of the distinctClause because
  * the parser already enforced that that matches ORDER BY.