aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/geqo/geqo_paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/geqo/geqo_paths.c')
-rw-r--r--src/backend/optimizer/geqo/geqo_paths.c58
1 files changed, 6 insertions, 52 deletions
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;
}