diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-16 21:30:30 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-16 21:30:30 +0000 |
commit | 9f76d0d926ffe72e32248b7c79f585c47e643981 (patch) | |
tree | 5fc47061415534dab7ff97519aea1603bccce0c9 /src/include | |
parent | 9cecff0314c3c75248f29fea6b80c19d9a8a8c70 (diff) | |
download | postgresql-9f76d0d926ffe72e32248b7c79f585c47e643981.tar.gz postgresql-9f76d0d926ffe72e32248b7c79f585c47e643981.zip |
Fix GEQO to work again in CVS tip, by being more careful about memory
allocation in best_inner_indexscan(). While at it, simplify GEQO's
interface to the main planner --- make_join_rel() offers exactly the
API it really wants, whereas calling make_rels_by_clause_joins() and
make_rels_by_clauseless_joins() required jumping through hoops.
Rewrite gimme_tree for clarity (sometimes iteration is much better than
recursion), and approximately halve GEQO's runtime by recognizing that
tours of the forms (a,b,c,d,...) and (b,a,c,d,...) are equivalent
because of symmetry in make_join_rel().
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/optimizer/geqo.h | 5 | ||||
-rw-r--r-- | src/include/optimizer/paths.h | 11 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/include/optimizer/geqo.h b/src/include/optimizer/geqo.h index 04af4d7d88c..aec82365407 100644 --- a/src/include/optimizer/geqo.h +++ b/src/include/optimizer/geqo.h @@ -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.h,v 1.29 2002/07/20 04:59:10 momjian Exp $ + * $Id: geqo.h,v 1.30 2002/12/16 21:30:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -74,7 +74,6 @@ extern RelOptInfo *geqo(Query *root, int number_of_rels, List *initial_rels); extern Cost geqo_eval(Query *root, List *initial_rels, Gene *tour, int num_gene); extern RelOptInfo *gimme_tree(Query *root, List *initial_rels, - Gene *tour, int num_gene, - int rel_count, RelOptInfo *old_rel); + Gene *tour, int num_gene); #endif /* GEQO_H */ diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 06f585f7220..7ed5b403a87 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: paths.h,v 1.62 2002/12/12 15:49:41 tgl Exp $ + * $Id: paths.h,v 1.63 2002/12/16 21:30:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -74,13 +74,10 @@ extern void add_paths_to_joinrel(Query *root, RelOptInfo *joinrel, * routines to determine which relations to join */ extern List *make_rels_by_joins(Query *root, int level, List **joinrels); -extern List *make_rels_by_clause_joins(Query *root, - RelOptInfo *old_rel, - List *other_rels); -extern List *make_rels_by_clauseless_joins(Query *root, - RelOptInfo *old_rel, - List *other_rels); extern RelOptInfo *make_jointree_rel(Query *root, Node *jtnode); +extern RelOptInfo *make_join_rel(Query *root, + RelOptInfo *rel1, RelOptInfo *rel2, + JoinType jointype); /* * pathkeys.c |