aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-11-06 00:00:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-11-06 00:00:45 +0000
commitf6dba10e623fa575c8446f854aa63c97d4fedea3 (patch)
tree2c5eb86c8e2961c90b524b49f25e3c25efa6eee2 /src/backend/nodes/outfuncs.c
parenta8c18b980e1e00fe08ac02562f81e3e64d4e9fd4 (diff)
downloadpostgresql-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/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index e1a34118a62..2d6db222b29 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.176 2002/10/14 22:14:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.177 2002/11/06 00:00:44 tgl Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -597,6 +597,8 @@ _outAgg(StringInfo str, Agg *node)
{
appendStringInfo(str, " AGG ");
_outPlanInfo(str, (Plan *) node);
+ appendStringInfo(str, " :aggstrategy %d :numCols %d ",
+ (int) node->aggstrategy, node->numCols);
}
static void
@@ -604,11 +606,7 @@ _outGroup(StringInfo str, Group *node)
{
appendStringInfo(str, " GRP ");
_outPlanInfo(str, (Plan *) node);
-
- /* the actual Group fields */
- appendStringInfo(str, " :numCols %d :tuplePerGroup %s ",
- node->numCols,
- booltostr(node->tuplePerGroup));
+ appendStringInfo(str, " :numCols %d ", node->numCols);
}
static void
@@ -1115,6 +1113,26 @@ _outAppendPath(StringInfo str, AppendPath *node)
}
/*
+ * ResultPath is a subclass of Path.
+ */
+static void
+_outResultPath(StringInfo str, ResultPath *node)
+{
+ appendStringInfo(str,
+ " RESULTPATH :pathtype %d :startup_cost %.2f :total_cost %.2f :pathkeys ",
+ node->path.pathtype,
+ node->path.startup_cost,
+ node->path.total_cost);
+ _outNode(str, node->path.pathkeys);
+
+ appendStringInfo(str, " :subpath ");
+ _outNode(str, node->subpath);
+
+ appendStringInfo(str, " :constantqual ");
+ _outNode(str, node->constantqual);
+}
+
+/*
* NestPath is a subclass of Path
*/
static void
@@ -1717,6 +1735,9 @@ _outNode(StringInfo str, void *obj)
case T_AppendPath:
_outAppendPath(str, obj);
break;
+ case T_ResultPath:
+ _outResultPath(str, obj);
+ break;
case T_NestPath:
_outNestPath(str, obj);
break;