From f6dba10e623fa575c8446f854aa63c97d4fedea3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 6 Nov 2002 00:00:45 +0000 Subject: 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. --- src/backend/commands/explain.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/explain.c') diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index f0aabc9dc8d..3d916949243 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.89 2002/10/14 04:26:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.90 2002/11/06 00:00:43 tgl Exp $ * */ @@ -275,7 +275,21 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, pname = "Group"; break; case T_Agg: - pname = "Aggregate"; + switch (((Agg *) plan)->aggstrategy) + { + case AGG_PLAIN: + pname = "Aggregate"; + break; + case AGG_SORTED: + pname = "GroupAggregate"; + break; + case AGG_HASHED: + pname = "HashAggregate"; + break; + default: + pname = "Aggregate ???"; + break; + } break; case T_Unique: pname = "Unique"; -- cgit v1.2.3