aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/geqo
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/geqo')
-rw-r--r--src/backend/optimizer/geqo/geqo_eval.c6
-rw-r--r--src/backend/optimizer/geqo/geqo_paths.c58
2 files changed, 8 insertions, 56 deletions
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c
index db1a3516476..574cdb9c234 100644
--- a/src/backend/optimizer/geqo/geqo_eval.c
+++ b/src/backend/optimizer/geqo/geqo_eval.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.27 1999/02/10 21:02:34 momjian Exp $
+ * $Id: geqo_eval.c,v 1.28 1999/02/12 05:56:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -161,8 +161,7 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *out
new_rel = (RelOptInfo *) lfirst(new_rels);
rel_count++;
- /* process new_rel->cheapestpath, new_rel->unorderedpath */
- geqo_rel_paths(new_rel);
+ geqo_set_cheapest(new_rel);
/* processing of other new_rel attributes */
if (new_rel->size <= 0)
@@ -282,7 +281,6 @@ init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * joininfo)
joinrel->width = 0;
/* joinrel->targetlist = NIL;*/
joinrel->pathlist = NIL;
- joinrel->unorderedpath = (Path *) NULL;
joinrel->cheapestpath = (Path *) NULL;
joinrel->pruneable = true;
joinrel->classlist = NULL;
diff --git a/src/backend/optimizer/geqo/geqo_paths.c b/src/backend/optimizer/geqo/geqo_paths.c
index a04c1703f7e..c372ebf2dae 100644
--- a/src/backend/optimizer/geqo/geqo_paths.c
+++ b/src/backend/optimizer/geqo/geqo_paths.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_paths.c,v 1.16 1999/02/11 14:58:50 momjian Exp $
+ * $Id: geqo_paths.c,v 1.17 1999/02/12 05:56:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,7 +29,6 @@
static List *geqo_prune_rel(RelOptInfo *rel, List *other_rels);
-static Path *set_paths(RelOptInfo *rel, Path *unorderedpath);
/*
* geqo-prune-rels--
@@ -92,62 +91,17 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
}
/*
- * geqo-rel-paths--
+ * geqo-set-cheapest--
* For a relation 'rel' (which corresponds to a join
- * relation), set pointers to the unordered path and cheapest paths
- * (if the unordered path isn't the cheapest, it is pruned), and
- * reset the relation's size field to reflect the join.
- *
- * Returns nothing of interest.
- *
+ * relation), set pointers to the cheapest path
*/
void
-geqo_rel_paths(RelOptInfo *rel)
+geqo_set_cheapest(RelOptInfo *rel)
{
- List *y = NIL;
- Path *path = (Path *) NULL;
- JoinPath *cheapest = (JoinPath *) NULL;
-
- rel->size = 0;
- foreach(y, rel->pathlist)
- {
- path = (Path *) lfirst(y);
-
- if (!path->pathorder->ord.sortop)
- break;
- }
+ JoinPath *cheapest = (JoinPath *)set_cheapest(rel, rel->pathlist);
- cheapest = (JoinPath *) set_paths(rel, path);
if (IsA_JoinPath(cheapest))
rel->size = compute_joinrel_size(cheapest);
-}
-
-
-/*
- * set-path--
- * Compares the unordered path for a relation with the cheapest path. If
- * the unordered path is not cheapest, it is pruned.
- *
- * Resets the pointers in 'rel' for unordered and cheapest paths.
- *
- * Returns the cheapest path.
- *
- */
-static Path *
-set_paths(RelOptInfo *rel, Path *unorderedpath)
-{
- Path *cheapest = set_cheapest(rel, rel->pathlist);
-
- /* don't prune if not pruneable -- JMH, 11/23/92 */
- if (unorderedpath != cheapest
- && rel->pruneable)
- {
-
- rel->unorderedpath = (Path *) NULL;
- rel->pathlist = lremove(unorderedpath, rel->pathlist);
- }
else
- rel->unorderedpath = (Path *) unorderedpath;
-
- return cheapest;
+ rel->size = 0;
}