mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Change my-function-name-- to my_function_name, and optimizer renames.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* createplan.c--
|
||||
* createplan.c
|
||||
* Routines to create the desired plan for processing a query
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.45 1999/02/12 17:24:51 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.46 1999/02/13 23:16:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -76,9 +76,9 @@ static Material *make_material(List *tlist, Oid nonameid, Plan *lefttree,
|
||||
int keycount);
|
||||
|
||||
/*
|
||||
* create_plan--
|
||||
* create_plan
|
||||
* Creates the access plan for a query by tracing backwards through the
|
||||
* desired chain of pathnodes, starting at the node 'best-path'. For
|
||||
* desired chain of pathnodes, starting at the node 'best_path'. For
|
||||
* every pathnode found:
|
||||
* (1) Create a corresponding plan node containing appropriate id,
|
||||
* target list, and qualification information.
|
||||
@@ -86,7 +86,7 @@ static Material *make_material(List *tlist, Oid nonameid, Plan *lefttree,
|
||||
* relative values.
|
||||
* (3) Target lists are not modified, but will be in another routine.
|
||||
*
|
||||
* best-path is the best access path
|
||||
* best_path is the best access path
|
||||
*
|
||||
* Returns the optimal(?) access plan.
|
||||
*/
|
||||
@@ -147,10 +147,10 @@ create_plan(Path *best_path)
|
||||
}
|
||||
|
||||
/*
|
||||
* create_scan_node--
|
||||
* Create a scan path for the parent relation of 'best-path'.
|
||||
* create_scan_node
|
||||
* Create a scan path for the parent relation of 'best_path'.
|
||||
*
|
||||
* tlist is the targetlist for the base relation scanned by 'best-path'
|
||||
* tlist is the targetlist for the base relation scanned by 'best_path'
|
||||
*
|
||||
* Returns the scan node.
|
||||
*/
|
||||
@@ -194,12 +194,12 @@ create_scan_node(Path *best_path, List *tlist)
|
||||
}
|
||||
|
||||
/*
|
||||
* create_join_node --
|
||||
* Create a join path for 'best-path' and(recursively) paths for its
|
||||
* create_join_node
|
||||
* Create a join path for 'best_path' and(recursively) paths for its
|
||||
* inner and outer paths.
|
||||
*
|
||||
* 'tlist' is the targetlist for the join relation corresponding to
|
||||
* 'best-path'
|
||||
* 'best_path'
|
||||
*
|
||||
* Returns the join node.
|
||||
*/
|
||||
@@ -260,7 +260,7 @@ create_join_node(JoinPath *best_path, List *tlist)
|
||||
|
||||
/*
|
||||
* * Expensive function pullups may have pulled local predicates *
|
||||
* into this path node. Put them in the qpqual of the plan node. * --
|
||||
* into this path node. Put them in the qpqual of the plan node. *
|
||||
* JMH, 6/15/92
|
||||
*/
|
||||
if (get_loc_restrictinfo(best_path) != NIL)
|
||||
@@ -281,9 +281,9 @@ create_join_node(JoinPath *best_path, List *tlist)
|
||||
|
||||
|
||||
/*
|
||||
* create_seqscan_node--
|
||||
* Returns a seqscan node for the base relation scanned by 'best-path'
|
||||
* with restriction clauses 'scan-clauses' and targetlist 'tlist'.
|
||||
* create_seqscan_node
|
||||
* Returns a seqscan node for the base relation scanned by 'best_path'
|
||||
* with restriction clauses 'scan_clauses' and targetlist 'tlist'.
|
||||
*/
|
||||
static SeqScan *
|
||||
create_seqscan_node(Path *best_path, List *tlist, List *scan_clauses)
|
||||
@@ -309,9 +309,9 @@ create_seqscan_node(Path *best_path, List *tlist, List *scan_clauses)
|
||||
}
|
||||
|
||||
/*
|
||||
* create_indexscan_node--
|
||||
* Returns a indexscan node for the base relation scanned by 'best-path'
|
||||
* with restriction clauses 'scan-clauses' and targetlist 'tlist'.
|
||||
* create_indexscan_node
|
||||
* Returns a indexscan node for the base relation scanned by 'best_path'
|
||||
* with restriction clauses 'scan_clauses' and targetlist 'tlist'.
|
||||
*/
|
||||
static IndexScan *
|
||||
create_indexscan_node(IndexPath *best_path,
|
||||
@@ -758,7 +758,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
|
||||
|
||||
/*
|
||||
* switch_outer--
|
||||
* switch_outer
|
||||
* Given a list of merge clauses, rearranges the elements within the
|
||||
* clauses so the outer join variable is on the left and the inner is on
|
||||
* the right.
|
||||
@@ -798,7 +798,7 @@ switch_outer(List *clauses)
|
||||
}
|
||||
|
||||
/*
|
||||
* set-noname-tlist-operators--
|
||||
* set_noname_tlist_operators
|
||||
* Sets the key and keyop fields of resdom nodes in a target list.
|
||||
*
|
||||
* 'tlist' is the target list
|
||||
@@ -846,16 +846,16 @@ set_noname_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* make_noname--
|
||||
* make_noname
|
||||
* Create plan nodes to sort or materialize relations into noname. The
|
||||
* result returned for a sort will look like (SEQSCAN(SORT(plan-node)))
|
||||
* or (SEQSCAN(MATERIAL(plan-node)))
|
||||
* result returned for a sort will look like (SEQSCAN(SORT(plan_node)))
|
||||
* or (SEQSCAN(MATERIAL(plan_node)))
|
||||
*
|
||||
* 'tlist' is the target list of the scan to be sorted or hashed
|
||||
* 'pathkeys' is the list of keys which the sort or hash will be done on
|
||||
* 'operators' is the operators with which the sort or hash is to be done
|
||||
* (a list of operator OIDs)
|
||||
* 'plan-node' is the node which yields tuples for the sort
|
||||
* 'plan_node' is the node which yields tuples for the sort
|
||||
* 'nonametype' indicates which operation(sort or hash) to perform
|
||||
*/
|
||||
static Noname *
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* initsplan.c--
|
||||
* initsplan.c
|
||||
* Target list, qualification, joininfo initialization routines
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.22 1999/02/03 21:16:35 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.23 1999/02/13 23:16:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -39,8 +39,8 @@
|
||||
|
||||
extern int Quiet;
|
||||
|
||||
static void add_clause_to_rels(Query *root, List *clause);
|
||||
static void add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo,
|
||||
static void add_restrict_and_join_to_rel(Query *root, List *clause);
|
||||
static void add_join_info_to_rels(Query *root, RestrictInfo *restrictinfo,
|
||||
List *join_relids);
|
||||
static void add_vars_to_targetlist(Query *root, List *vars, List *join_relids);
|
||||
|
||||
@@ -55,16 +55,14 @@ static Oid hashjoinop(Expr *clause);
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* init-base-rel-tlist--
|
||||
* make_var_only_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
|
||||
* *query_relation_list*. Creates targetlist entries for each member of
|
||||
* 'tlist' and adds them to the tlist field of the appropriate rel node.
|
||||
*
|
||||
* Returns nothing.
|
||||
*/
|
||||
void
|
||||
init_base_rels_tlist(Query *root, List *tlist)
|
||||
make_var_only_tlist(Query *root, List *tlist)
|
||||
{
|
||||
List *tlist_vars = NIL;
|
||||
List *l = NIL;
|
||||
@@ -80,20 +78,19 @@ init_base_rels_tlist(Query *root, List *tlist)
|
||||
/* now, the target list only contains Var nodes */
|
||||
foreach(tvar, tlist_vars)
|
||||
{
|
||||
Var *var;
|
||||
Var *var = (Var *) lfirst(tvar);
|
||||
Index varno;
|
||||
RelOptInfo *result;
|
||||
|
||||
var = (Var *) lfirst(tvar);
|
||||
varno = var->varno;
|
||||
result = get_base_rel(root, varno);
|
||||
|
||||
add_tl_element(result, var);
|
||||
add_var_to_tlist(result, var);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* add_missing-vars-to-tlist--
|
||||
* 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
|
||||
@@ -121,7 +118,7 @@ add_missing_vars_to_tlist(Query *root, List *tlist)
|
||||
OIDOID, -1, 0, varno, ObjectIdAttributeNumber);
|
||||
/* add it to base_rel_list */
|
||||
result = get_base_rel(root, varno);
|
||||
add_tl_element(result, var);
|
||||
add_var_to_tlist(result, var);
|
||||
}
|
||||
pfree(relids);
|
||||
varno++;
|
||||
@@ -139,25 +136,25 @@ add_missing_vars_to_tlist(Query *root, List *tlist)
|
||||
|
||||
|
||||
/*
|
||||
* init-base-rels-qual--
|
||||
* add_restrict_and_join_to_rels-
|
||||
* Initializes RestrictInfo and JoinInfo fields of relation entries for all
|
||||
* relations appearing within clauses. Creates new relation entries if
|
||||
* necessary, adding them to *query-relation-list*.
|
||||
* necessary, adding them to *query_relation_list*.
|
||||
*
|
||||
* Returns nothing of interest.
|
||||
*/
|
||||
void
|
||||
init_base_rels_qual(Query *root, List *clauses)
|
||||
add_restrict_and_join_to_rels(Query *root, List *clauses)
|
||||
{
|
||||
List *clause;
|
||||
|
||||
foreach(clause, clauses)
|
||||
add_clause_to_rels(root, lfirst(clause));
|
||||
add_restrict_and_join_to_rel(root, lfirst(clause));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* add-clause-to-rels--
|
||||
* add_restrict_and_join_to_rel-
|
||||
* Add clause information to either the 'RestrictInfo' or 'JoinInfo' field
|
||||
* of a relation entry(depending on whether or not the clause is a join)
|
||||
* by creating a new RestrictInfo node and setting appropriate fields
|
||||
@@ -166,7 +163,7 @@ init_base_rels_qual(Query *root, List *clauses)
|
||||
* Returns nothing of interest.
|
||||
*/
|
||||
static void
|
||||
add_clause_to_rels(Query *root, List *clause)
|
||||
add_restrict_and_join_to_rel(Query *root, List *clause)
|
||||
{
|
||||
List *relids;
|
||||
List *vars;
|
||||
@@ -186,53 +183,43 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
|
||||
if (length(relids) == 1)
|
||||
{
|
||||
RelOptInfo *rel = get_base_rel(root, lfirsti(relids));
|
||||
|
||||
/*
|
||||
* There is only one relation participating in 'clause', so
|
||||
* 'clause' must be a restriction clause.
|
||||
*/
|
||||
RelOptInfo *rel = get_base_rel(root, lfirsti(relids));
|
||||
|
||||
/*
|
||||
* the selectivity of the clause must be computed regardless of
|
||||
* The selectivity of the clause must be computed regardless of
|
||||
* whether it's a restriction or a join clause
|
||||
*/
|
||||
if (is_funcclause((Node *) clause))
|
||||
{
|
||||
|
||||
/*
|
||||
* XXX If we have a func clause set selectivity to 1/3, really
|
||||
* need a true selectivity function.
|
||||
*/
|
||||
restrictinfo->selectivity = (Cost) 0.3333333;
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
|
||||
rel->restrictinfo = lcons(restrictinfo, rel->restrictinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* 'clause' is a join clause, since there is more than one atom in
|
||||
* the relid list.
|
||||
*/
|
||||
|
||||
if (is_funcclause((Node *) clause))
|
||||
{
|
||||
|
||||
/*
|
||||
* XXX If we have a func clause set selectivity to 1/3, really
|
||||
* need a true selectivity function.
|
||||
*/
|
||||
restrictinfo->selectivity = (Cost) 0.3333333;
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
|
||||
add_join_info_to_rels(root, restrictinfo, relids);
|
||||
/* we are going to be doing a join, so add var to targetlist */
|
||||
add_vars_to_targetlist(root, vars, relids);
|
||||
@@ -240,19 +227,19 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
}
|
||||
|
||||
/*
|
||||
* add-join-info-to-rels--
|
||||
* add_join_info_to_rels
|
||||
* For every relation participating in a join clause, add 'restrictinfo' to
|
||||
* the appropriate joininfo node(creating a new one and adding it to the
|
||||
* appropriate rel node if necessary).
|
||||
*
|
||||
* 'restrictinfo' describes the join clause
|
||||
* 'join-relids' is the list of relations participating in the join clause
|
||||
* 'join_relids' is the list of relations participating in the join clause
|
||||
*
|
||||
* Returns nothing.
|
||||
*
|
||||
*/
|
||||
static void
|
||||
add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relids)
|
||||
add_join_info_to_rels(Query *root, RestrictInfo *restrictinfo, List *join_relids)
|
||||
{
|
||||
List *join_relid;
|
||||
|
||||
@@ -276,7 +263,7 @@ add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relid
|
||||
}
|
||||
|
||||
/*
|
||||
* add-vars-to-targetlist--
|
||||
* 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.
|
||||
@@ -285,7 +272,7 @@ add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relid
|
||||
* entry of the targetlist entry.
|
||||
*
|
||||
* 'vars' is the list of var nodes
|
||||
* 'join-relids' is the list of relids appearing in the join clause
|
||||
* 'join_relids' is the list of relids appearing in the join clause
|
||||
* (if this is a join clause)
|
||||
*
|
||||
* Returns nothing.
|
||||
@@ -305,7 +292,7 @@ add_vars_to_targetlist(Query *root, List *vars, List *join_relids)
|
||||
tlistentry = tlistentry_member(var, rel->targetlist);
|
||||
if (tlistentry == NULL)
|
||||
/* add a new entry */
|
||||
add_tl_element(rel, var);
|
||||
add_var_to_tlist(rel, var);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +303,7 @@ add_vars_to_targetlist(Query *root, List *vars, List *join_relids)
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* init-join-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 restrictinfo node(within a joininfo node) for all relations in a
|
||||
@@ -372,7 +359,7 @@ init_join_info(List *rel_list)
|
||||
}
|
||||
|
||||
/*
|
||||
* mergejoinop--
|
||||
* mergejoinop
|
||||
* Returns the mergejoin operator of an operator iff 'clause' is
|
||||
* mergejoinable, i.e., both operands are single vars and the operator is
|
||||
* a mergejoinable operator.
|
||||
@@ -406,7 +393,7 @@ mergejoinop(Expr *clause)
|
||||
}
|
||||
|
||||
/*
|
||||
* hashjoinop--
|
||||
* hashjoinop
|
||||
* Returns the hashjoin operator of an operator iff 'clause' is
|
||||
* hashjoinable, i.e., both operands are single vars and the operator is
|
||||
* a hashjoinable operator.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* planmain.c--
|
||||
* planmain.c
|
||||
* Routines to plan a single query
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.30 1999/02/09 17:03:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.31 1999/02/13 23:16:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ extern Plan *make_groupPlan(List **tlist, bool tuplePerGroup,
|
||||
List *groupClause, Plan *subplan);
|
||||
|
||||
/*
|
||||
* query_planner--
|
||||
* query_planner
|
||||
* Routine to create a query plan. It does so by first creating a
|
||||
* subplan for the topmost level of attributes in the query. Then,
|
||||
* it modifies all target list and qualifications to consider the next
|
||||
@@ -58,7 +58,7 @@ extern Plan *make_groupPlan(List **tlist, bool tuplePerGroup,
|
||||
* be placed where and any relation level qualifications to be
|
||||
* satisfied.
|
||||
*
|
||||
* command-type is the query command, e.g., retrieve, delete, etc.
|
||||
* command-type is the query command, e.g., select, delete, etc.
|
||||
* tlist is the target list of the query
|
||||
* qual is the qualification of the query
|
||||
*
|
||||
@@ -134,7 +134,6 @@ query_planner(Query *root,
|
||||
*/
|
||||
if (var_only_tlist == NULL && qual == NULL)
|
||||
{
|
||||
|
||||
switch (command_type)
|
||||
{
|
||||
case CMD_SELECT:
|
||||
@@ -143,7 +142,6 @@ query_planner(Query *root,
|
||||
(Node *) constant_qual,
|
||||
(Plan *) NULL));
|
||||
break;
|
||||
|
||||
case CMD_DELETE:
|
||||
case CMD_UPDATE:
|
||||
{
|
||||
@@ -153,16 +151,13 @@ query_planner(Query *root,
|
||||
(Plan *) NULL);
|
||||
|
||||
if (constant_qual != NULL)
|
||||
{
|
||||
return ((Plan *) make_result(tlist,
|
||||
(Node *) constant_qual,
|
||||
(Plan *) scan));
|
||||
}
|
||||
else
|
||||
return (Plan *) scan;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return (Plan *) NULL;
|
||||
}
|
||||
@@ -236,7 +231,7 @@ query_planner(Query *root,
|
||||
* Subplanner creates an entire plan consisting of joins and scans
|
||||
* for processing a single level of attributes.
|
||||
*
|
||||
* flat-tlist is the flattened target list
|
||||
* flat_tlist is the flattened target list
|
||||
* qual is the qualification to be satisfied
|
||||
*
|
||||
* Returns a subplan.
|
||||
@@ -258,8 +253,8 @@ subplanner(Query *root,
|
||||
root->base_rel_list = NIL;
|
||||
root->join_rel_list = NIL;
|
||||
|
||||
init_base_rels_tlist(root, flat_tlist);
|
||||
init_base_rels_qual(root, qual);
|
||||
make_var_only_tlist(root, flat_tlist);
|
||||
add_restrict_and_join_to_rels(root, qual);
|
||||
add_missing_vars_to_tlist(root, flat_tlist);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* planner.c--
|
||||
* planner.c
|
||||
* The query optimizer external interface.
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.43 1999/02/09 17:03:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.44 1999/02/13 23:16:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -91,7 +91,7 @@ planner(Query *parse)
|
||||
}
|
||||
|
||||
/*
|
||||
* union_planner--
|
||||
* union_planner
|
||||
*
|
||||
* Invokes the planner on union queries if there are any left,
|
||||
* recursing if necessary to get them all, then processes normal plans.
|
||||
@@ -357,7 +357,7 @@ union_planner(Query *parse)
|
||||
}
|
||||
|
||||
/*
|
||||
* make_sortplan--
|
||||
* make_sortplan
|
||||
* Returns a sortplan which is basically a SORT node attached to the
|
||||
* top of the plan returned from the planner. It also adds the
|
||||
* cost of sorting into the plan.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* setrefs.c--
|
||||
* setrefs.c
|
||||
* Routines to change varno/attno entries to contain references
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.38 1999/02/09 17:03:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.39 1999/02/13 23:16:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ static void set_result_tlist_references(Result *resultNode);
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* set-tlist-references--
|
||||
* set_tlist_references
|
||||
* Modifies the target list of nodes in a plan to reference target lists
|
||||
* at lower levels.
|
||||
*
|
||||
@@ -85,7 +85,7 @@ set_tlist_references(Plan *plan)
|
||||
}
|
||||
|
||||
/*
|
||||
* set-join-tlist-references--
|
||||
* set_join_tlist_references
|
||||
* Modifies the target list of a join node by setting the varnos and
|
||||
* varattnos to reference the target list of the outer and inner join
|
||||
* relations.
|
||||
@@ -136,7 +136,7 @@ set_join_tlist_references(Join *join)
|
||||
}
|
||||
|
||||
/*
|
||||
* set-nonamescan-tlist-references--
|
||||
* set_nonamescan_tlist_references
|
||||
* Modifies the target list of a node that scans a noname relation (i.e., a
|
||||
* sort or hash node) so that the varnos refer to the child noname.
|
||||
*
|
||||
@@ -156,7 +156,7 @@ set_nonamescan_tlist_references(SeqScan *nonamescan)
|
||||
}
|
||||
|
||||
/*
|
||||
* set-noname-tlist-references--
|
||||
* set_noname_tlist_references
|
||||
* The noname's vars are made consistent with (actually, identical to) the
|
||||
* modified version of the target list of the node from which noname node
|
||||
* receives its tuples.
|
||||
@@ -182,14 +182,14 @@ set_noname_tlist_references(Noname *noname)
|
||||
}
|
||||
|
||||
/*
|
||||
* join-references--
|
||||
* join_references
|
||||
* Creates a new set of join clauses by replacing the varno/varattno
|
||||
* values of variables in the clauses to reference target list values
|
||||
* from the outer and inner join relation target lists.
|
||||
*
|
||||
* 'clauses' is the list of join clauses
|
||||
* 'outer-tlist' is the target list of the outer join relation
|
||||
* 'inner-tlist' is the target list of the inner join relation
|
||||
* 'outer_tlist' is the target list of the outer join relation
|
||||
* 'inner_tlist' is the target list of the inner join relation
|
||||
*
|
||||
* Returns the new join clauses.
|
||||
*
|
||||
@@ -205,16 +205,16 @@ join_references(List *clauses,
|
||||
}
|
||||
|
||||
/*
|
||||
* index-outerjoin-references--
|
||||
* index_outerjoin_references
|
||||
* Given a list of join clauses, replace the operand corresponding to the
|
||||
* outer relation in the join with references to the corresponding target
|
||||
* list element in 'outer-tlist' (the outer is rather obscurely
|
||||
* list element in 'outer_tlist' (the outer is rather obscurely
|
||||
* identified as the side that doesn't contain a var whose varno equals
|
||||
* 'inner-relid').
|
||||
* 'inner_relid').
|
||||
*
|
||||
* As a side effect, the operator is replaced by the regproc id.
|
||||
*
|
||||
* 'inner-indxqual' is the list of join clauses (so-called because they
|
||||
* 'inner_indxqual' is the list of join clauses (so-called because they
|
||||
* are used as qualifications for the inner (inbex) scan of a nestloop)
|
||||
*
|
||||
* Returns the new list of clauses.
|
||||
@@ -268,17 +268,17 @@ index_outerjoin_references(List *inner_indxqual,
|
||||
}
|
||||
|
||||
/*
|
||||
* replace-clause-joinvar-refs
|
||||
* replace-subclause-joinvar-refs
|
||||
* replace-joinvar-refs
|
||||
* replace_clause_joinvar_refs
|
||||
* replace_subclause_joinvar_refs
|
||||
* replace_joinvar_refs
|
||||
*
|
||||
* Replaces all variables within a join clause with a new var node
|
||||
* whose varno/varattno fields contain a reference to a target list
|
||||
* element from either the outer or inner join relation.
|
||||
*
|
||||
* 'clause' is the join clause
|
||||
* 'outer-tlist' is the target list of the outer join relation
|
||||
* 'inner-tlist' is the target list of the inner join relation
|
||||
* 'outer_tlist' is the target list of the outer join relation
|
||||
* 'inner_tlist' is the target list of the inner join relation
|
||||
*
|
||||
* Returns the new join clause.
|
||||
*
|
||||
@@ -475,7 +475,7 @@ replace_joinvar_refs(Var *var, List *outer_tlist, List *inner_tlist)
|
||||
}
|
||||
|
||||
/*
|
||||
* tlist-noname-references--
|
||||
* tlist_noname_references
|
||||
* Creates a new target list for a node that scans a noname relation,
|
||||
* setting the varnos to the id of the noname relation and setting varids
|
||||
* if necessary (varids are only needed if this is a targetlist internal
|
||||
@@ -937,7 +937,7 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
|
||||
|
||||
/* Check if the VAR is already contained in the targetlist */
|
||||
if (tlist_member((Var *) clause, (List *) targetlist_so_far) == NULL)
|
||||
add_tl_element(&tmp_rel, (Var *) clause);
|
||||
add_var_to_tlist(&tmp_rel, (Var *) clause);
|
||||
|
||||
return tmp_rel.targetlist;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* subselect.c--
|
||||
* subselect.c
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user