diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-06 00:00:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-06 00:00:45 +0000 |
commit | f6dba10e623fa575c8446f854aa63c97d4fedea3 (patch) | |
tree | 2c5eb86c8e2961c90b524b49f25e3c25efa6eee2 /src/include/optimizer/planmain.h | |
parent | a8c18b980e1e00fe08ac02562f81e3e64d4e9fd4 (diff) | |
download | postgresql-f6dba10e623fa575c8446f854aa63c97d4fedea3.tar.gz postgresql-f6dba10e623fa575c8446f854aa63c97d4fedea3.zip |
First phase of implementing hash-based grouping/aggregation. An AGG plan
node now does its own grouping of the input rows, and has no need for a
preceding GROUP node in the plan pipeline. This allows elimination of
the misnamed tuplePerGroup option for GROUP, and actually saves more code
in nodeGroup.c than it costs in nodeAgg.c, as well as being presumably
faster. Restructure the API of query_planner so that we do not commit to
using a sorted or unsorted plan in query_planner; instead grouping_planner
makes the decision. (Right now it isn't any smarter than query_planner
was, but that will change as soon as it has the option to select a hash-
based aggregation step.) Despite all the hackery, no initdb needed since
only in-memory node types changed.
Diffstat (limited to 'src/include/optimizer/planmain.h')
-rw-r--r-- | src/include/optimizer/planmain.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index d31cee5ddc7..c927d540740 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: planmain.h,v 1.60 2002/09/04 20:31:45 momjian Exp $ + * $Id: planmain.h,v 1.61 2002/11/06 00:00:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,8 @@ /* * prototypes for plan/planmain.c */ -extern Plan *query_planner(Query *root, List *tlist, double tuple_fraction); +extern void query_planner(Query *root, List *tlist, double tuple_fraction, + Path **cheapest_path, Path **sorted_path); /* * prototypes for plan/createplan.c @@ -33,9 +34,10 @@ extern Sort *make_sort(Query *root, List *tlist, Plan *lefttree, int keycount); extern Sort *make_sort_from_pathkeys(Query *root, List *tlist, Plan *lefttree, List *pathkeys); -extern Agg *make_agg(List *tlist, List *qual, Plan *lefttree); -extern Group *make_group(List *tlist, bool tuplePerGroup, int ngrp, - AttrNumber *grpColIdx, Plan *lefttree); +extern Agg *make_agg(List *tlist, List *qual, AggStrategy aggstrategy, + int ngrp, AttrNumber *grpColIdx, Plan *lefttree); +extern Group *make_group(List *tlist, int ngrp, AttrNumber *grpColIdx, + Plan *lefttree); extern Material *make_material(List *tlist, Plan *lefttree); extern Unique *make_unique(List *tlist, Plan *lefttree, List *distinctList); extern Limit *make_limit(List *tlist, Plan *lefttree, |