mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Cleanup optimizer function names and clarify code.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,7 +45,9 @@ int32 _use_geqo_rels_ = GEQO_RELS;
|
||||
|
||||
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--
|
||||
@@ -74,7 +76,6 @@ find_paths(Query *root, List *rels)
|
||||
|
||||
if (levels_needed <= 1)
|
||||
{
|
||||
|
||||
/*
|
||||
* Unsorted single relation, no more processing is required.
|
||||
*/
|
||||
@@ -82,7 +83,6 @@ find_paths(Query *root, List *rels)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* this means that joins or sorts are required. set selectivities
|
||||
* of clauses that have not been set by an index.
|
||||
@@ -115,8 +115,7 @@ find_rel_paths(Query *root, List *rels)
|
||||
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,
|
||||
@@ -181,7 +180,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
|
||||
* <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 */
|
||||
|
||||
/*******************************************
|
||||
@@ -255,10 +254,10 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
|
||||
* 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;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -662,7 +662,7 @@ match_clause_to_indexkey(RelOptInfo *rel,
|
||||
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;
|
||||
|
||||
@@ -1153,7 +1153,7 @@ extract_restrict_clauses(List *clausegroup)
|
||||
{
|
||||
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;
|
||||
@@ -1282,7 +1282,7 @@ create_index_paths(Query *root,
|
||||
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;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -74,7 +74,7 @@ find_join_rels(Query *root, List *outer_rels)
|
||||
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);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -734,7 +734,7 @@ xfunc_card_unreferenced(Query *queryInfo,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user