~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/backend/optimizer/plan/planmain.c

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Backport
  • Date: 2009-11-09 13:46:16 UTC
  • mfrom: (5.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091109134616-ae14l9tr3g7p2t9y
Tags: 8.4.1-1~hardy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 *
16
16
 * IDENTIFICATION
17
 
 *        $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.114 2009/01/01 17:23:44 momjian Exp $
 
17
 *        $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.115 2009/06/11 14:48:59 momjian Exp $
18
18
 *
19
19
 *-------------------------------------------------------------------------
20
20
 */
289
289
                /*
290
290
                 * If both GROUP BY and ORDER BY are specified, we will need two
291
291
                 * levels of sort --- and, therefore, certainly need to read all the
292
 
                 * tuples --- unless ORDER BY is a subset of GROUP BY.  Likewise if
293
 
                 * we have both DISTINCT and GROUP BY, or if we have a window
 
292
                 * tuples --- unless ORDER BY is a subset of GROUP BY.  Likewise if we
 
293
                 * have both DISTINCT and GROUP BY, or if we have a window
294
294
                 * specification not compatible with the GROUP BY.
295
295
                 */
296
296
                if (!pathkeys_contained_in(root->sort_pathkeys, root->group_pathkeys) ||
297
297
                        !pathkeys_contained_in(root->distinct_pathkeys, root->group_pathkeys) ||
298
 
                        !pathkeys_contained_in(root->window_pathkeys, root->group_pathkeys))
 
298
                 !pathkeys_contained_in(root->window_pathkeys, root->group_pathkeys))
299
299
                        tuple_fraction = 0.0;
300
300
        }
301
301
        else if (parse->hasAggs || root->hasHavingQual)