Re-enable bushy plans. Vadim want them.

This commit is contained in:
Bruce Momjian 1999-02-16 00:41:03 +00:00
parent cd550c7672
commit c82ca4c158
7 changed files with 23 additions and 71 deletions

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -119,14 +119,12 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *out
inner_rel->joininfo, inner_rel->joininfo,
inner_rel->relids))) inner_rel->relids)))
{ {
#ifdef NOT_USED if (!BushyPlanFlag)
if (BushyPlanFlag) new_rels = make_rels_by_clauseless_joins(outer_rel,
lcons(inner_rel,NIL));
else
new_rels = make_rels_by_clauseless_joins(outer_rel, new_rels = make_rels_by_clauseless_joins(outer_rel,
lcons(outer_rel,NIL)); lcons(outer_rel,NIL));
else
#endif
new_rels = make_rels_by_clauseless_joins(outer_rel,
lcons(inner_rel,NIL));
} }
/* process new_rel->pathlist */ /* process new_rel->pathlist */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -203,7 +203,6 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
rels_set_cheapest(joined_rels); rels_set_cheapest(joined_rels);
#ifdef NOT_USED
if (BushyPlanFlag) if (BushyPlanFlag)
{ {
/* /*
@ -214,7 +213,6 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
*/ */
add_rel_to_rel_joininfos(root, joined_rels, rels); add_rel_to_rel_joininfos(root, joined_rels, rels);
} }
#endif
foreach(x, joined_rels) foreach(x, joined_rels)
{ {
@ -230,35 +228,28 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
#endif #endif
} }
#ifdef NOT_USED
if (BushyPlanFlag) if (BushyPlanFlag)
{ {
/* /*
* prune rels that have been completely incorporated into new * prune rels that have been completely incorporated into new
* join rels * 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 * 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; root->join_rel_list = rels = joined_rels;
} }
#ifdef NOT_USED
Assert(BushyPlanFlag || length(rels) == 1); Assert(BushyPlanFlag || length(rels) == 1);
#endif
Assert(length(rels) == 1);
#ifdef NOT_USED if (!BushyPlanFlag)
if (BushyPlanFlag) return lfirst(rels);
return get_cheapest_complete_rel(rels);
else else
#endif return get_cheapest_complete_rel(rels);
return lfirst(rels);
} }
/***************************************************************************** /*****************************************************************************

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -70,12 +70,11 @@ make_rels_by_joins(Query *root, List *outer_rels)
* Oops, we have a relation that is not joined to any other * Oops, we have a relation that is not joined to any other
* relation. Cartesian product time. * relation. Cartesian product time.
*/ */
#ifdef NOT_USED if (!BushyPlanFlag)
if (BushyPlanFlag) joins = make_rels_by_clauseless_joins(outer_rel,
joins = make_rels_by_clauseless_joins(outer_rel, outer_rels); root->base_rel_list);
else else
#endif joins = make_rels_by_clauseless_joins(outer_rel, outer_rels);
joins = make_rels_by_clauseless_joins(outer_rel, root->base_rel_list);
} }
join_list = nconc(join_list, joins); join_list = nconc(join_list, joins);
@ -137,14 +136,12 @@ make_rels_by_clause_joins(Query *root, RelOptInfo *outer_rel,
joininfo); joininfo);
} }
} }
#ifdef NOT_USED
else if (BushyPlanFlag) else if (BushyPlanFlag)
{ {
rel = make_join_rel(outer_rel, rel = make_join_rel(outer_rel,
get_join_rel(root, unjoined_rels), get_join_rel(root, unjoined_rels),
joininfo); joininfo);
} }
#endif
else else
rel = NULL; rel = NULL;
@ -246,10 +243,8 @@ make_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo)
if (joininfo) if (joininfo)
{ {
joinrel->restrictinfo = joininfo->jinfo_restrictinfo; joinrel->restrictinfo = joininfo->jinfo_restrictinfo;
#ifdef NOT_USED
if (BushyPlanFlag) if (BushyPlanFlag)
joininfo->bushy_inactive = true; joininfo->bushy_inactive = true;
#endif
} }
joinrel_joininfo_list = new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo), joinrel_joininfo_list = new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
@ -471,7 +466,6 @@ add_rel_to_rel_joininfos(Query *root, List *joinrels, List *outerrels)
} }
} }
#ifdef NOT_USED
/* /*
* get_cheapest_complete_rel * get_cheapest_complete_rel
* Find the join relation that includes all the original * Find the join relation that includes all the original
@ -515,7 +509,6 @@ get_cheapest_complete_rel(List *join_rel_list)
return final_rel; return final_rel;
} }
#endif
/* /*
* add_superrels * add_superrels

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -106,31 +106,6 @@ rels_set_cheapest(List *rel_list)
} }
} }
#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 * del_rels_all_bushy_inactive
* If all the joininfo's in a rel node are bushy_inactive, * If all the joininfo's in a rel node are bushy_inactive,
@ -175,5 +150,4 @@ del_rels_all_bushy_inactive(List *old_rels)
} }
return temp_list; return temp_list;
} }
#endif

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
@ -173,10 +173,8 @@ int UseNewLine = 0; /* Use EOF as query delimiters */
* plans * plans
* ---------------- * ----------------
*/ */
#ifdef NOT_USED
int BushyPlanFlag = 0; /* default to false -- consider only int BushyPlanFlag = 0; /* default to false -- consider only
* left-deep trees */ * left-deep trees */
#endif
/* /*
** Flags for expensive function optimization -- JMH 3/9/92 ** Flags for expensive function optimization -- JMH 3/9/92
@ -1043,7 +1041,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
#endif #endif
break; break;
#ifdef NOT_USED
case 'b': case 'b':
/* ---------------- /* ----------------
* set BushyPlanFlag to true. * set BushyPlanFlag to true.
@ -1051,7 +1048,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
*/ */
BushyPlanFlag = 1; BushyPlanFlag = 1;
break; break;
#endif
case 'B': case 'B':
/* ---------------- /* ----------------
@ -1542,7 +1538,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
{ {
puts("\nPOSTGRES backend interactive interface "); 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");
} }
/* ---------------- /* ----------------

View File

@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -80,9 +80,7 @@
#define FLOAT_EQUAL(X,Y) ((X) - (Y) < TOLERANCE) #define FLOAT_EQUAL(X,Y) ((X) - (Y) < TOLERANCE)
#define FLOAT_IS_ZERO(X) (FLOAT_EQUAL(X,0.0)) #define FLOAT_IS_ZERO(X) (FLOAT_EQUAL(X,0.0))
#ifdef NOT_USED
extern int BushyPlanFlag; extern int BushyPlanFlag;
#endif
/* #define deactivate_joininfo(joininfo) joininfo->inactive=true*/ /* #define deactivate_joininfo(joininfo) joininfo->inactive=true*/
/*#define joininfo_inactive(joininfo) joininfo->inactive */ /*#define joininfo_inactive(joininfo) joininfo->inactive */

View File

@ -7,7 +7,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -85,11 +85,13 @@ extern List *make_rels_by_clauseless_joins(RelOptInfo *outer_rel,
List *inner_rels); List *inner_rels);
extern RelOptInfo *make_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo); 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 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 * prototypes for path/prune.c
*/ */
extern void merge_rels_with_same_relids(List *rel_list); extern void merge_rels_with_same_relids(List *rel_list);
extern void rels_set_cheapest(List *rel_list); extern void rels_set_cheapest(List *rel_list);
extern List *del_rels_all_bushy_inactive(List *old_rels);
#endif /* PATHS_H */ #endif /* PATHS_H */