preprocess target list
preprocess qualifications(WHERE)
--query_planner()
- cnfify qualification, so qual are expressions (were AND's) and OR clauses
+ cnfify()
+ Summary:
+
+ Simple cases with all AND's are handled by removing the AND's:
+
+ convert: a = 1 AND b = 2 AND c = 3
+ to: a = 1, b = 2, c = 3
+
+ Qualifications with OR's are handled differently. OR's inside AND
+ clauses are not modified drastically:
+
+ convert: a = 1 AND b = 2 AND (c = 3 OR d = 4)
+ to: a = 1, b = 2, c = 3 OR d = 4
+
+ OR's in the upper level are more complex to handle:
+
+ convert: (a = 1 AND b = 2) OR c = 3
+ to: (a = 1 OR c = 3) AND (b = 2 OR c = 3)
+ finally: (a = 1 OR c = 3), (b = 2 OR c = 3)
+
+ These clauses all have to be true for a result to be returned,
+ so the optimizer can choose the most restrictive clauses.
+
pull out constants from target list
get a target list that only contains column names, no expressions
if none, then return
---subplanner()
make list of relations in target
make list of relations in where clause
+ split up the qual into restrictions (a=1) and joins (b=c)
find which relations can do merge sort and hash joins
----find_paths()
find scan and all index paths for each relation not yet joined
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.21 1998/08/04 16:44:02 momjian Exp $
+ * $Id: geqo_eval.c,v 1.22 1998/08/10 02:26:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *temp;
-/* remember root->join_relation_list_ ... */
-/* because root->join_relation_list_ will be changed during the following */
- temp = listCopy(root->join_relation_list_);
+/* remember root->join_rel_list ... */
+/* because root->join_rel_list will be changed during the following */
+ temp = listCopy(root->join_rel_list);
/* joinrel is readily processed query tree -- left-sided ! */
joinrel = gimme_tree(root, tour, 0, num_gene, NULL);
/* compute fitness */
fitness = (Cost) joinrel->cheapestpath->path_cost;
- root->join_relation_list_ = listCopy(temp);
+ root->join_rel_list = listCopy(temp);
pfree(joinrel);
freeList(temp);
/* tour[0] = 3; tour[1] = 1; tour[2] = 2 */
base_rel_index = (int) tour[rel_count];
- inner_rel = (RelOptInfo *) geqo_nth(base_rel_index, root->base_relation_list_);
+ inner_rel = (RelOptInfo *) geqo_nth(base_rel_index, root->base_rel_list);
if (rel_count == 0)
{ /* processing first join with
new_rel->size = compute_rel_size(new_rel);
new_rel->width = compute_rel_width(new_rel);
- root->join_relation_list_ = lcons(new_rel, NIL);
+ root->join_rel_list = lcons(new_rel, NIL);
return gimme_tree(root, tour, rel_count, num_gene, new_rel);
}
*/
/*
- * if ( (root->join_relation_list_) != NIL ) { rel =
+ * if ( (root->join_rel_list) != NIL ) { rel =
* get_join_rel(root, xrelid); } else { rel =
* get_base_rel(root, lfirsti(xrelid)); }
*/
*/
relids = lconsi(lfirsti(xrelid), NIL);
- rel = rel_member(relids, root->base_relation_list_);
+ rel = rel_member(relids, root->base_rel_list);
add_superrels(rel, joinrel);
}
*/
/*
- * if ( (root->join_relation_list_) != NIL ) { rel =
+ * if ( (root->join_rel_list) != NIL ) { rel =
* get_join_rel(root, xrelid); } else { rel =
* get_base_rel(root, lfirsti(xrelid)); }
*/
*/
relids = lconsi(lfirsti(xrelid), NIL);
- rel = rel_member(relids, root->base_relation_list_);
+ rel = rel_member(relids, root->base_rel_list);
super_rels = rel->superrels;
new_joininfo = makeNode(JInfo);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_main.c,v 1.8 1998/07/18 04:22:27 momjian Exp $
+ * $Id: geqo_main.c,v 1.9 1998/08/10 02:26:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* set tour size */
- number_of_rels = length(root->base_relation_list_);
+ number_of_rels = length(root->base_rel_list);
/* set GA parameters */
geqo_params(number_of_rels);/* out of "$PGDATA/pg_geqo" file */
*
*
* IDENTIFICATION
-* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.6 1998/07/18 04:22:29 momjian Exp $
+* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.7 1998/08/10 02:26:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
void
minspantree(Query *root, List *join_rels, RelOptInfo *garel)
{
- int number_of_rels = length(root->base_relation_list_);
+ int number_of_rels = length(root->base_rel_list);
int number_of_joins = length(join_rels);
int *connectto;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.19 1998/08/07 05:02:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.20 1998/08/10 02:26:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void find_rel_paths(Query *root, List *rels);
static List *find_join_paths(Query *root, List *outer_rels, int levels_needed);
+#ifdef OPTIMIZER_DEBUG
static void debug_print_rel(Query *root, RelOptInfo *rel);
+#endif
/*
* find-paths--
if (levels_needed <= 1)
{
-
/*
* Unsorted single relation, no more processing is required.
*/
}
else
{
-
/*
* this means that joins or sorts are required. set selectivities
* of clauses that have not been set by an index.
List *or_index_scan_list;
RelOptInfo *rel = (RelOptInfo *) lfirst(temp);
- sequential_scan_list = lcons(create_seqscan_path(rel),
- NIL);
+ sequential_scan_list = lcons(create_seqscan_path(rel), NIL);
rel_index_scan_list =
find_index_paths(root,
* <utesch@aut.tu-freiberg.de> *
*******************************************/
- if ((_use_geqo_) && length(root->base_relation_list_) >= _use_geqo_rels_)
+ if ((_use_geqo_) && length(root->base_rel_list) >= _use_geqo_rels_)
return lcons(geqo(root), NIL); /* returns *one* RelOptInfo, so lcons it */
/*******************************************
* merge join rels if then contain the same list of base rels
*/
outer_rels = merge_joinrels(new_rels, outer_rels);
- root->join_relation_list_ = outer_rels;
+ root->join_rel_list = outer_rels;
}
else
- root->join_relation_list_ = new_rels;
+ root->join_rel_list = new_rels;
if (!BushyPlanFlag)
outer_rels = new_rels;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.25 1998/08/04 16:44:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.26 1998/08/10 02:26:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
join_op = ((Oper *) ((Expr *) clause)->oper)->opno;
if (join_op && op_class(join_op, xclass, index->relam) &&
- join_clause_p((Node *) clause))
+ is_joinable((Node *) clause))
{
isIndexable = true;
{
CInfo *cinfo = lfirst(l);
- if (!join_clause_p((Node *) cinfo->clause))
+ if (!is_joinable((Node *) cinfo->clause))
restrict_cls = lappend(restrict_cls, cinfo);
}
return restrict_cls;
foreach(j, clausegroup)
{
clauseinfo = (CInfo *) lfirst(j);
- if (!(join_clause_p((Node *) clauseinfo->clause) &&
+ if (!(is_joinable((Node *) clauseinfo->clause) &&
equal_path_merge_ordering(index->ordering,
clauseinfo->mergejoinorder)))
temp = false;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.12 1998/08/04 16:44:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.13 1998/08/10 02:26:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (BushyPlanFlag)
joins = find_clauseless_joins(outer_rel, outer_rels);
else
- joins = find_clauseless_joins(outer_rel, root->base_relation_list_);
+ joins = find_clauseless_joins(outer_rel, root->base_rel_list);
}
join_list = nconc(join_list, joins);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.17 1998/08/04 16:44:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.18 1998/08/10 02:26:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
LispValue temp;
/* find all relids of base relations referenced in query */
- foreach(temp, queryInfo->base_relation_list_)
+ foreach(temp, queryInfo->base_rel_list)
{
Assert(lnext(get_relids((RelOptInfo) lfirst(temp))) == LispNil);
allrelids = lappend(allrelids,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.17 1998/08/09 04:59:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.18 1998/08/10 02:26:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/relation.h"
#include "nodes/makefuncs.h"
+#include "access/htup.h"
+
+#include "catalog/pg_type.h"
+
#include "utils/lsyscache.h"
#include "utils/palloc.h"
extern int Quiet;
static void add_clause_to_rels(Query *root, List *clause);
-static void add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo,
+static void add_join_info_to_rels(Query *root, CInfo *clauseinfo,
List *join_relids);
-static void add_vars_to_rels(Query *root, List *vars, List *join_relids);
+static void add_vars_to_targetlist(Query *root, List *vars, List *join_relids);
static MergeOrder *mergejoinop(Expr *clause);
static Oid hashjoinop(Expr *clause);
*****************************************************************************/
/*
- * initialize_rel_nodes--
+ * init-base-rel-tlist--
* Creates rel nodes for every relation mentioned in the target list
* 'tlist' (if a node hasn't already been created) and adds them to
* *query-relation-list*. Creates targetlist entries for each member of
* Returns nothing.
*/
void
-initialize_base_rels_list(Query *root, List *tlist)
+init_base_rels_tlist(Query *root, List *tlist)
{
List *tlist_vars = NIL;
List *l = NIL;
{
Var *var;
Index varno;
- RelOptInfo *result;
+ RelOptInfo *result;
var = (Var *) lfirst(tvar);
varno = var->varno;
}
/*
- * add_missing_variables_to_base_rels -
+ * add_missing-vars-to-tlist--
* If we have range variable(s) in the FROM clause that does not appear
* in the target list nor qualifications, we add it to the base relation
* list. For instance, "select f.x from foo f, foo f2" is a join of f and
* into a join.
*/
void
-add_missing_vars_to_base_rels(Query *root, List *tlist)
+add_missing_vars_to_tlist(Query *root, List *tlist)
{
List *l;
int varno;
{
RangeTblEntry *rte = (RangeTblEntry *) lfirst(l);
List *relids;
- RelOptInfo *result;
+ RelOptInfo *result;
Var *var;
relids = lconsi(varno, NIL);
- if (rte->inFromCl &&
- !rel_member(relids, root->base_relation_list_))
+ if (rte->inFromCl && !rel_member(relids, root->base_rel_list))
{
-
- var = makeVar(varno, -2, 26, -1, 0, varno, -2);
- /* add it to base_relation_list_ */
+ var = makeVar(varno, ObjectIdAttributeNumber,
+ OIDOID, -1, 0, varno, ObjectIdAttributeNumber);
+ /* add it to base_rel_list */
result = get_base_rel(root, varno);
add_tl_element(result, var);
}
/*
- * initialize-qualification--
+ * init-base-rels-qual--
* Initializes ClauseInfo and JoinInfo fields of relation entries for all
* relations appearing within clauses. Creates new relation entries if
* necessary, adding them to *query-relation-list*.
* Returns nothing of interest.
*/
void
-initialize_base_rels_jinfo(Query *root, List *clauses)
+init_base_rels_qual(Query *root, List *clauses)
{
List *clause;
*/
clause_get_relids_vars((Node *) clause, &relids, &vars);
-
clauseinfo->clause = (Expr *) clause;
clauseinfo->notclause = contains_not((Node *) clause);
clauseinfo->selectivity = 0;
if (length(relids) == 1)
{
- RelOptInfo *rel = get_base_rel(root, lfirsti(relids));
+ RelOptInfo *rel = get_base_rel(root, lfirsti(relids));
/*
* There is only one relation participating in 'clause', so
*/
if (is_funcclause((Node *) clause))
{
-
/*
* XXX If we have a func clause set selectivity to 1/3, really
* need a true selectivity function.
clauseinfo->selectivity =
compute_clause_selec(root, (Node *) clause, NIL);
}
- rel->clauseinfo = lcons(clauseinfo,
- rel->clauseinfo);
+ rel->clauseinfo = lcons(clauseinfo, rel->clauseinfo);
}
else
{
if (is_funcclause((Node *) clause))
{
-
/*
* XXX If we have a func clause set selectivity to 1/3, really
* need a true selectivity function.
else
{
clauseinfo->selectivity =
- compute_clause_selec(root, (Node *) clause,
- NIL);
+ compute_clause_selec(root, (Node *) clause, NIL);
}
- add_join_clause_info_to_rels(root, clauseinfo, relids);
- add_vars_to_rels(root, vars, relids);
+ add_join_info_to_rels(root, clauseinfo, relids);
+ /* we are going to be doing a join, so add var to targetlist */
+ add_vars_to_targetlist(root, vars, relids);
}
}
/*
- * add-join-clause-info-to-rels--
+ * add-join-info-to-rels--
* For every relation participating in a join clause, add 'clauseinfo' to
* the appropriate joininfo node(creating a new one and adding it to the
* appropriate rel node if necessary).
*
*/
static void
-add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo, List *join_relids)
+add_join_info_to_rels(Query *root, CInfo *clauseinfo, List *join_relids)
{
List *join_relid;
other_rels = lappendi(other_rels, lfirsti(rel));
}
- joininfo =
- find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
+ joininfo = find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
other_rels);
joininfo->jinfoclauseinfo =
lcons(copyObject((void *) clauseinfo), joininfo->jinfoclauseinfo);
}
/*
- * add-vars-to-rels--
+ * add-vars-to-targetlist--
* For each variable appearing in a clause,
* (1) If a targetlist entry for the variable is not already present in
* the appropriate relation's target list, add one.
* Returns nothing.
*/
static void
-add_vars_to_rels(Query *root, List *vars, List *join_relids)
+add_vars_to_targetlist(Query *root, List *vars, List *join_relids)
{
Var *var;
List *temp = NIL;
- RelOptInfo *rel = (RelOptInfo *) NULL;
+ RelOptInfo *rel = (RelOptInfo *) NULL;
TargetEntry *tlistentry;
foreach(temp, vars)
*****************************************************************************/
/*
- * initialize-join-clause-info--
+ * init-join-info--
* Set the MergeJoinable or HashJoinable field for every joininfo node
* (within a rel node) and the MergeJoinOrder or HashJoinOp field for
* each clauseinfo node(within a joininfo node) for all relations in a
* Returns nothing.
*/
void
-initialize_join_clause_info(List *rel_list)
+init_join_info(List *rel_list)
{
List *x,
*y,
*z;
- RelOptInfo *rel;
+ RelOptInfo *rel;
JInfo *joininfo;
CInfo *clauseinfo;
Expr *clause;
{
clauseinfo = (CInfo *) lfirst(z);
clause = clauseinfo->clause;
- if (join_clause_p((Node *) clause))
+ if (is_joinable((Node *) clause))
{
MergeOrder *sortop = (MergeOrder *) NULL;
Oid hashop = (Oid) NULL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.24 1998/08/07 05:02:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.25 1998/08/10 02:26:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *flat_tlist,
List *qual)
{
- RelOptInfo *final_relation;
- List *final_relation_list;
+ RelOptInfo *final_rel;
+ List *final_rel_list;
/*
* Initialize the targetlist and qualification, adding entries to
- * *query-relation-list* as relation references are found (e.g., in
+ * base_rel_list as relation references are found (e.g., in
* the qualification, the targetlist, etc.)
*/
- root->base_relation_list_ = NIL;
- root->join_relation_list_ = NIL;
- initialize_base_rels_list(root, flat_tlist);
- initialize_base_rels_jinfo(root, qual);
- add_missing_vars_to_base_rels(root, flat_tlist);
+ root->base_rel_list = NIL;
+ root->join_rel_list = NIL;
+
+ init_base_rels_tlist(root, flat_tlist);
+ init_base_rels_qual(root, qual);
+ add_missing_vars_to_tlist(root, flat_tlist);
/*
* Find all possible scan and join paths. Mark all the clauses and
* relations that can be processed using special join methods, then do
* the exhaustive path search.
*/
- initialize_join_clause_info(root->base_relation_list_);
- final_relation_list = find_paths(root,
- root->base_relation_list_);
+ init_join_info(root->base_rel_list);
+ final_rel_list = find_paths(root, root->base_rel_list);
- if (final_relation_list)
- final_relation = (RelOptInfo *) lfirst(final_relation_list);
+ if (final_rel_list)
+ final_rel = (RelOptInfo *) lfirst(final_rel_list);
else
- final_relation = (RelOptInfo *) NIL;
+ final_rel = (RelOptInfo *) NIL;
#if 0 /* fix xfunc */
* expensive functions left to pull up. -- JMH, 11/22/92
*/
if (XfuncMode != XFUNC_OFF && XfuncMode != XFUNC_NOPM &&
- XfuncMode != XFUNC_NOPULL && !final_relation->pruneable)
+ XfuncMode != XFUNC_NOPULL && !final_rel->pruneable)
{
List *pathnode;
- foreach(pathnode, final_relation->pathlist)
+ foreach(pathnode, final_rel->pathlist)
{
if (xfunc_do_predmig((Path *) lfirst(pathnode)))
- set_cheapest(final_relation, final_relation->pathlist);
+ set_cheapest(final_rel, final_rel->pathlist);
}
}
#endif
* Determine the cheapest path and create a subplan corresponding to
* it.
*/
- if (final_relation)
- return (create_plan((Path *) final_relation->cheapestpath));
+ if (final_rel)
+ return (create_plan((Path *) final_rel->cheapestpath));
else
{
elog(NOTICE, "final relation is nil");
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.19 1998/08/09 04:59:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.20 1998/08/10 02:26:29 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
}
/*
- * join-clause-p--
+ * is_joinable--
*
* Returns t iff 'clause' is a valid join clause.
*
*/
bool
-join_clause_p(Node *clause)
+is_joinable(Node *clause)
{
Node *leftop,
*rightop;
* One side of the clause (i.e. left or right operands) must either be
* a var node ...
*/
- if (IsA(leftop, Var) ||IsA(rightop, Var))
+ if (IsA(leftop, Var) || IsA(rightop, Var))
return true;
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.9 1998/08/04 16:44:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.10 1998/08/10 02:26:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
retval = (Var *) NULL;
- if (var != NULL && join_clause_p((Node *) clause))
+ if (var != NULL && is_joinable((Node *) clause))
{
l = (Var *) get_leftop(clause);
r = (Var *) get_rightop(clause);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.6 1998/07/18 04:22:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.7 1998/08/10 02:26:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
RelOptInfo *rel;
relids = lconsi(relid, NIL);
- rel = rel_member(relids, root->base_relation_list_);
+ rel = rel_member(relids, root->base_rel_list);
if (rel == NULL)
{
rel = makeNode(RelOptInfo);
rel->innerjoin = NIL;
rel->superrels = NIL;
- root->base_relation_list_ = lcons(rel,
- root->base_relation_list_);
+ root->base_rel_list = lcons(rel, root->base_rel_list);
/*
* ??? the old lispy C code (get_rel) do a listp(relid) here but
*/
if (relid < 0)
{
-
/*
* If the relation is a materialized relation, assume
* constants for sizes.
RelOptInfo *
get_join_rel(Query *root, List *relid)
{
- return rel_member(relid, root->join_relation_list_);
+ return rel_member(relid, root->join_rel_list);
}
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.24 1998/08/06 05:12:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.25 1998/08/10 02:26:33 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.53 1998/08/05 04:49:13 scrappy Exp $
+ * $Id: parsenodes.h,v 1.54 1998/08/10 02:26:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* query */
/* internal to planner */
- List *base_relation_list_; /* base relation list */
- List *join_relation_list_; /* list of relations */
+ List *base_rel_list; /* base relation list */
+ List *join_rel_list; /* list of relation involved in joins */
} Query;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: clauses.h,v 1.11 1998/08/09 04:59:08 momjian Exp $
+ * $Id: clauses.h,v 1.12 1998/08/10 02:26:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void clause_get_relids_vars(Node *clause, List **relids, List **vars);
extern int NumRelids(Node *clause);
extern bool contains_not(Node *clause);
-extern bool join_clause_p(Node *clause);
+extern bool is_joinable(Node *clause);
extern bool qual_clause_p(Node *clause);
extern void fix_opid(Node *clause);
extern List *fix_opids(List *clauses);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: planmain.h,v 1.13 1998/07/19 05:49:25 momjian Exp $
+ * $Id: planmain.h,v 1.14 1998/08/10 02:26:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* prototypes for plan/initsplan.c
*/
-extern void initialize_base_rels_list(Query *root, List *tlist);
-extern void initialize_base_rels_jinfo(Query *root, List *clauses);
-extern void initialize_join_clause_info(List *rel_list);
-extern void add_missing_vars_to_base_rels(Query *root, List *tlist);
+extern void init_base_rels_tlist(Query *root, List *tlist);
+extern void init_base_rels_qual(Query *root, List *clauses);
+extern void init_join_info(List *rel_list);
+extern void add_missing_vars_to_tlist(Query *root, List *tlist);
/*
* prototypes for plan/setrefs.c