*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.32 1999/02/15 03:22:00 momjian Exp $
+ * $Id: geqo_eval.c,v 1.33 1999/02/16 00:40:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
inner_rel->joininfo,
inner_rel->relids)))
{
-#ifdef NOT_USED
- if (BushyPlanFlag)
+ if (!BushyPlanFlag)
new_rels = make_rels_by_clauseless_joins(outer_rel,
- lcons(outer_rel,NIL));
- else
-#endif
- new_rels = make_rels_by_clauseless_joins(outer_rel,
lcons(inner_rel,NIL));
+ else
+ new_rels = make_rels_by_clauseless_joins(outer_rel,
+ lcons(outer_rel,NIL));
}
/* process new_rel->pathlist */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.39 1999/02/15 05:49:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.40 1999/02/16 00:40:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
rels_set_cheapest(joined_rels);
-#ifdef NOT_USED
if (BushyPlanFlag)
{
/*
*/
add_rel_to_rel_joininfos(root, joined_rels, rels);
}
-#endif
foreach(x, joined_rels)
{
#endif
}
-#ifdef NOT_USED
if (BushyPlanFlag)
{
/*
* prune rels that have been completely incorporated into new
* join rels
*/
- rels = del_rels_all_bushy_inactive(rels);
+ joined_rels = del_rels_all_bushy_inactive(rels);
/*
* merge join rels if then contain the same list of base rels
*/
- joined_rels = merge_rels_with_same_relids(joined_rels, rels);
+ merge_rels_with_same_relids(joined_rels);
}
-#endif
root->join_rel_list = rels = joined_rels;
}
-#ifdef NOT_USED
Assert(BushyPlanFlag || length(rels) == 1);
-#endif
- Assert(length(rels) == 1);
-#ifdef NOT_USED
- if (BushyPlanFlag)
- return get_cheapest_complete_rel(rels);
+ if (!BushyPlanFlag)
+ return lfirst(rels);
else
-#endif
- return lfirst(rels);
+ return get_cheapest_complete_rel(rels);
}
/*****************************************************************************
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.25 1999/02/15 05:21:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.26 1999/02/16 00:41:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* Oops, we have a relation that is not joined to any other
* relation. Cartesian product time.
*/
-#ifdef NOT_USED
- if (BushyPlanFlag)
- joins = make_rels_by_clauseless_joins(outer_rel, outer_rels);
+ if (!BushyPlanFlag)
+ joins = make_rels_by_clauseless_joins(outer_rel,
+ root->base_rel_list);
else
-#endif
- joins = make_rels_by_clauseless_joins(outer_rel, root->base_rel_list);
+ joins = make_rels_by_clauseless_joins(outer_rel, outer_rels);
}
join_list = nconc(join_list, joins);
joininfo);
}
}
-#ifdef NOT_USED
else if (BushyPlanFlag)
{
rel = make_join_rel(outer_rel,
get_join_rel(root, unjoined_rels),
joininfo);
}
-#endif
else
rel = NULL;
if (joininfo)
{
joinrel->restrictinfo = joininfo->jinfo_restrictinfo;
-#ifdef NOT_USED
if (BushyPlanFlag)
joininfo->bushy_inactive = true;
-#endif
}
joinrel_joininfo_list = new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
}
}
-#ifdef NOT_USED
/*
* get_cheapest_complete_rel
* Find the join relation that includes all the original
return final_rel;
}
-#endif
/*
* add_superrels
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.35 1999/02/15 05:21:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.36 1999/02/16 00:41:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
}
-#ifdef NOT_USED
-/*
- * merge_rels_with_same_relids
- * Given two lists of rel nodes that are already
- * pruned, merge them into one pruned rel node list
- *
- * 'rel_list1' and
- * 'rel_list2' are the rel node lists
- *
- * Returns one pruned rel node list
- */
-List *
-merge_rels_with_same_relids(List *rel_list1, List *rel_list2)
-{
- List *xrel = NIL;
-
- foreach(xrel, rel_list1)
- {
- RelOptInfo *rel = (RelOptInfo *) lfirst(xrel);
-
- rel_list2 = merge_rel_with_same_relids(rel, rel_list2);
- }
- return append(rel_list1, rel_list2);
-}
-
/*
* del_rels_all_bushy_inactive
* If all the joininfo's in a rel node are bushy_inactive,
}
return temp_list;
}
-#endif
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.100 1999/02/15 03:22:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.101 1999/02/16 00:41:01 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
* plans
* ----------------
*/
-#ifdef NOT_USED
int BushyPlanFlag = 0; /* default to false -- consider only
* left-deep trees */
-#endif
/*
** Flags for expensive function optimization -- JMH 3/9/92
#endif
break;
-#ifdef NOT_USED
case 'b':
/* ----------------
* set BushyPlanFlag to true.
*/
BushyPlanFlag = 1;
break;
-#endif
case 'B':
/* ----------------
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.100 $ $Date: 1999/02/15 03:22:21 $\n");
+ puts("$Revision: 1.101 $ $Date: 1999/02/16 00:41:01 $\n");
}
/* ----------------
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: internal.h,v 1.15 1999/02/15 03:22:31 momjian Exp $
+ * $Id: internal.h,v 1.16 1999/02/16 00:41:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define FLOAT_EQUAL(X,Y) ((X) - (Y) < TOLERANCE)
#define FLOAT_IS_ZERO(X) (FLOAT_EQUAL(X,0.0))
-#ifdef NOT_USED
extern int BushyPlanFlag;
-#endif
/* #define deactivate_joininfo(joininfo) joininfo->inactive=true*/
/*#define joininfo_inactive(joininfo) joininfo->inactive */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: paths.h,v 1.19 1999/02/15 05:28:10 momjian Exp $
+ * $Id: paths.h,v 1.20 1999/02/16 00:41:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *inner_rels);
extern RelOptInfo *make_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo);
extern List *new_join_tlist(List *tlist, List *other_relids,int first_resdomno);
+extern RelOptInfo *get_cheapest_complete_rel(List *join_rel_list);
/*
* prototypes for path/prune.c
*/
extern void merge_rels_with_same_relids(List *rel_list);
extern void rels_set_cheapest(List *rel_list);
+extern List *del_rels_all_bushy_inactive(List *old_rels);
#endif /* PATHS_H */