diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-03 19:10:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-03 19:10:52 +0000 |
commit | ec73b56a31fd0933280e85cd4e7b17c45c2ccbed (patch) | |
tree | 64ac1c86f0213f7f233caa77f4970fd25d4898fb /src/backend/optimizer/plan/planmain.c | |
parent | 82a1f0995337bb771b61955c959c5f624340ec5b (diff) | |
download | postgresql-ec73b56a31fd0933280e85cd4e7b17c45c2ccbed.tar.gz postgresql-ec73b56a31fd0933280e85cd4e7b17c45c2ccbed.zip |
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.
Diffstat (limited to 'src/backend/optimizer/plan/planmain.c')
-rw-r--r-- | src/backend/optimizer/plan/planmain.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) |