From ec73b56a31fd0933280e85cd4e7b17c45c2ccbed Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 3 Aug 2008 19:10:52 +0000 Subject: Make GROUP BY work properly for datatypes that only support hashing and not sorting. The infrastructure for this was all in place already; it's only necessary to fix the planner to not assume that sorting is always an available option. --- src/backend/optimizer/plan/planmain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/backend/optimizer/plan/planmain.c') diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index d25a5509b4c..5e5da6cda4f 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.107 2008/07/31 22:47:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.108 2008/08/03 19:10:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -288,8 +288,7 @@ query_planner(PlannerInfo *root, List *tlist, * levels of sort --- and, therefore, certainly need to read all the * tuples --- unless ORDER BY is a subset of GROUP BY. */ - if (root->group_pathkeys && root->sort_pathkeys && - !pathkeys_contained_in(root->sort_pathkeys, root->group_pathkeys)) + if (!pathkeys_contained_in(root->sort_pathkeys, root->group_pathkeys)) tuple_fraction = 0.0; } else if (parse->hasAggs || root->hasHavingQual) -- cgit v1.2.3