mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
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.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_misc.h,v 1.21 2002/09/04 20:31:45 momjian Exp $
|
||||
* $Id: geqo_misc.h,v 1.22 2002/11/06 00:00:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -32,9 +32,6 @@ extern void print_pool(FILE *fp, Pool *pool, int start, int stop);
|
||||
extern void print_gen(FILE *fp, Pool *pool, int generation);
|
||||
extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene);
|
||||
|
||||
extern void geqo_print_rel(Query *root, RelOptInfo *rel);
|
||||
extern void geqo_print_path(Query *root, Path *path, int indent);
|
||||
extern void geqo_print_joinclauses(Query *root, List *clauses);
|
||||
#endif /* GEQO_DEBUG */
|
||||
|
||||
#endif /* GEQO_MISC_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: pathnode.h,v 1.44 2002/06/20 20:29:51 momjian Exp $
|
||||
* $Id: pathnode.h,v 1.45 2002/11/06 00:00:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -35,6 +35,8 @@ extern IndexPath *create_index_path(Query *root, RelOptInfo *rel,
|
||||
extern TidPath *create_tidscan_path(Query *root, RelOptInfo *rel,
|
||||
List *tideval);
|
||||
extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths);
|
||||
extern ResultPath *create_result_path(RelOptInfo *rel, Path *subpath,
|
||||
List *constantqual);
|
||||
extern Path *create_subqueryscan_path(RelOptInfo *rel);
|
||||
extern Path *create_functionscan_path(Query *root, RelOptInfo *rel);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user