summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-09-04 20:31:48 +0000
committerBruce Momjian <bruce@momjian.us>2002-09-04 20:31:48 +0000
commite50f52a074bdf0d6a9dc384840e641c4c0b0bb1a (patch)
treeab73e8c8ec94a6ddc774c1f9c49b87aa6b93fd13 /src/backend/optimizer/plan
parentc91ceec21d357d6d857163d897ac75a79c883dee (diff)
downloadpostgresql-e50f52a074bdf0d6a9dc384840e641c4c0b0bb1a.tar.gz
pgindent run.
Diffstat (limited to 'src/backend/optimizer/plan')
-rw-r--r--src/backend/optimizer/plan/createplan.c12
-rw-r--r--src/backend/optimizer/plan/initsplan.c28
-rw-r--r--src/backend/optimizer/plan/planner.c46
-rw-r--r--src/backend/optimizer/plan/setrefs.c6
-rw-r--r--src/backend/optimizer/plan/subselect.c8
5 files changed, 53 insertions, 47 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 908d36bccc..da3568bbd7 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.117 2002/09/02 02:47:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.118 2002/09/04 20:31:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,7 +79,7 @@ static IndexScan *make_indexscan(List *qptlist, List *qpqual, Index scanrelid,
static TidScan *make_tidscan(List *qptlist, List *qpqual, Index scanrelid,
List *tideval);
static FunctionScan *make_functionscan(List *qptlist, List *qpqual,
- Index scanrelid);
+ Index scanrelid);
static NestLoop *make_nestloop(List *tlist,
List *joinclauses, List *otherclauses,
Plan *lefttree, Plan *righttree,
@@ -206,8 +206,8 @@ create_scan_plan(Query *root, Path *best_path)
case T_FunctionScan:
plan = (Scan *) create_functionscan_plan(best_path,
- tlist,
- scan_clauses);
+ tlist,
+ scan_clauses);
break;
default:
@@ -1346,8 +1346,8 @@ make_functionscan(List *qptlist,
List *qpqual,
Index scanrelid)
{
- FunctionScan *node = makeNode(FunctionScan);
- Plan *plan = &node->scan.plan;
+ FunctionScan *node = makeNode(FunctionScan);
+ Plan *plan = &node->scan.plan;
/* cost should be inserted by caller */
plan->state = (EState *) NULL;
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 0187c21d29..e06282c126 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.74 2002/09/02 02:47:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.75 2002/09/04 20:31:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -108,12 +108,15 @@ add_base_rels_to_query(Query *root, Node *jtnode)
add_base_rels_to_query(root, j->rarg));
/* the join's own rtindex is NOT added to result */
jrel = build_other_rel(root, j->rtindex);
+
/*
- * Mark the join's otherrel with outerjoinset = list of baserel ids
- * included in the join. Note we must copy here because result list
- * is destructively modified by nconcs at higher levels.
+ * Mark the join's otherrel with outerjoinset = list of baserel
+ * ids included in the join. Note we must copy here because
+ * result list is destructively modified by nconcs at higher
+ * levels.
*/
jrel->outerjoinset = listCopy(result);
+
/*
* Safety check: join RTEs should not be SELECT FOR UPDATE targets
*/
@@ -172,8 +175,8 @@ add_vars_to_targetlist(Query *root, List *vars)
if (rel->reloptkind == RELOPT_OTHER_JOIN_REL)
{
/* Var is an alias */
- Node *expansion;
- List *varsused;
+ Node *expansion;
+ List *varsused;
expansion = flatten_join_alias_vars((Node *) var,
root->rtable, true);
@@ -196,7 +199,7 @@ add_vars_to_targetlist(Query *root, List *vars)
* distribute_quals_to_rels
* Recursively scan the query's join tree for WHERE and JOIN/ON qual
* clauses, and add these to the appropriate RestrictInfo and JoinInfo
- * lists belonging to base RelOptInfos. Also, base RelOptInfos are marked
+ * lists belonging to base RelOptInfos. Also, base RelOptInfos are marked
* with outerjoinset information, to aid in proper positioning of qual
* clauses that appear above outer joins.
*
@@ -400,7 +403,8 @@ distribute_qual_to_rels(Query *root, Node *clause,
restrictinfo->right_sortop = InvalidOid;
restrictinfo->left_pathkey = NIL; /* not computable yet */
restrictinfo->right_pathkey = NIL;
- restrictinfo->left_mergescansel = -1; /* not computed until needed */
+ restrictinfo->left_mergescansel = -1; /* not computed until
+ * needed */
restrictinfo->right_mergescansel = -1;
restrictinfo->hashjoinoperator = InvalidOid;
restrictinfo->left_bucketsize = -1; /* not computed until needed */
@@ -419,7 +423,7 @@ distribute_qual_to_rels(Query *root, Node *clause,
* earlier by add_base_rels_to_query.
*
* We can combine this step with a cross-check that the clause contains
- * no relids not within its scope. If the first crosscheck succeeds,
+ * no relids not within its scope. If the first crosscheck succeeds,
* the clause contains no aliases and we needn't look more closely.
*/
if (!is_subseti(relids, qualscope))
@@ -763,10 +767,10 @@ process_implied_equality(Query *root, Node *item1, Node *item2,
clause = makeNode(Expr);
clause->typeOid = BOOLOID;
clause->opType = OP_EXPR;
- clause->oper = (Node *) makeOper(oprid(eq_operator),/* opno */
+ clause->oper = (Node *) makeOper(oprid(eq_operator), /* opno */
InvalidOid, /* opid */
- BOOLOID, /* opresulttype */
- false); /* opretset */
+ BOOLOID, /* opresulttype */
+ false); /* opretset */
clause->args = makeList2(item1, item2);
ReleaseSysCache(eq_operator);
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index b55f8380d4..5510a74957 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.123 2002/08/28 20:46:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.124 2002/09/04 20:31:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -42,7 +42,7 @@
static Node *pull_up_subqueries(Query *parse, Node *jtnode,
- bool below_outer_join);
+ bool below_outer_join);
static bool is_simple_subquery(Query *subquery);
static bool has_nullable_targetlist(Query *subquery);
static void resolvenew_in_jointree(Node *jtnode, int varno, List *subtlist);
@@ -301,16 +301,16 @@ pull_up_subqueries(Query *parse, Node *jtnode, bool below_outer_join)
*
* If we are inside an outer join, only pull up subqueries whose
* targetlists are nullable --- otherwise substituting their tlist
- * entries for upper Var references would do the wrong thing
- * (the results wouldn't become NULL when they're supposed to).
- * XXX This could be improved by generating pseudo-variables for
- * such expressions; we'd have to figure out how to get the pseudo-
- * variables evaluated at the right place in the modified plan tree.
- * Fix it someday.
+ * entries for upper Var references would do the wrong thing (the
+ * results wouldn't become NULL when they're supposed to). XXX
+ * This could be improved by generating pseudo-variables for such
+ * expressions; we'd have to figure out how to get the pseudo-
+ * variables evaluated at the right place in the modified plan
+ * tree. Fix it someday.
*
* Note: even if the subquery itself is simple enough, we can't pull
- * it up if there is a reference to its whole tuple result. Perhaps
- * a pseudo-variable is the answer here too.
+ * it up if there is a reference to its whole tuple result.
+ * Perhaps a pseudo-variable is the answer here too.
*/
if (rte->rtekind == RTE_SUBQUERY && is_simple_subquery(subquery) &&
(!below_outer_join || has_nullable_targetlist(subquery)) &&
@@ -336,8 +336,8 @@ pull_up_subqueries(Query *parse, Node *jtnode, bool below_outer_join)
below_outer_join);
/*
- * Now make a modifiable copy of the subquery that we can
- * run OffsetVarNodes on.
+ * Now make a modifiable copy of the subquery that we can run
+ * OffsetVarNodes on.
*/
subquery = copyObject(subquery);
@@ -352,7 +352,8 @@ pull_up_subqueries(Query *parse, Node *jtnode, bool below_outer_join)
* Replace all of the top query's references to the subquery's
* outputs with copies of the adjusted subtlist items, being
* careful not to replace any of the jointree structure.
- * (This'd be a lot cleaner if we could use query_tree_mutator.)
+ * (This'd be a lot cleaner if we could use
+ * query_tree_mutator.)
*/
subtlist = subquery->targetList;
parse->targetList = (List *)
@@ -375,15 +376,16 @@ pull_up_subqueries(Query *parse, Node *jtnode, bool below_outer_join)
}
/*
- * Now append the adjusted rtable entries to upper query.
- * (We hold off until after fixing the upper rtable entries;
- * no point in running that code on the subquery ones too.)
+ * Now append the adjusted rtable entries to upper query. (We
+ * hold off until after fixing the upper rtable entries; no
+ * point in running that code on the subquery ones too.)
*/
parse->rtable = nconc(parse->rtable, subquery->rtable);
/*
* Pull up any FOR UPDATE markers, too. (OffsetVarNodes
- * already adjusted the marker values, so just nconc the list.)
+ * already adjusted the marker values, so just nconc the
+ * list.)
*/
parse->rowMarks = nconc(parse->rowMarks, subquery->rowMarks);
@@ -500,9 +502,9 @@ is_simple_subquery(Query *subquery)
/*
* Don't pull up a subquery that has any set-returning functions in
- * its targetlist. Otherwise we might well wind up inserting
- * set-returning functions into places where they mustn't go,
- * such as quals of higher queries.
+ * its targetlist. Otherwise we might well wind up inserting
+ * set-returning functions into places where they mustn't go, such as
+ * quals of higher queries.
*/
if (expression_returns_set((Node *) subquery->targetList))
return false;
@@ -724,8 +726,8 @@ preprocess_expression(Query *parse, Node *expr, int kind)
/*
* If the query has any join RTEs, try to replace join alias variables
- * with base-relation variables, to allow quals to be pushed down.
- * We must do this after sublink processing, since it does not recurse
+ * with base-relation variables, to allow quals to be pushed down. We
+ * must do this after sublink processing, since it does not recurse
* into sublinks.
*
* The flattening pass is expensive enough that it seems worthwhile to
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index b685cfa3ba..66998b036f 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.80 2002/09/02 02:47:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.81 2002/09/04 20:31:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -423,7 +423,7 @@ join_references_mutator(Node *node,
resdom = tlist_member((Node *) var, context->outer_tlist);
if (resdom)
{
- Var *newvar = (Var *) copyObject(var);
+ Var *newvar = (Var *) copyObject(var);
newvar->varno = OUTER;
newvar->varattno = resdom->resno;
@@ -432,7 +432,7 @@ join_references_mutator(Node *node,
resdom = tlist_member((Node *) var, context->inner_tlist);
if (resdom)
{
- Var *newvar = (Var *) copyObject(var);
+ Var *newvar = (Var *) copyObject(var);
newvar->varno = INNER;
newvar->varattno = resdom->resno;
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index c1ab186b01..1dcebba2e7 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.54 2002/06/20 20:29:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.55 2002/09/04 20:31:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -369,7 +369,7 @@ make_subplan(SubLink *slink)
}
if (use_material)
{
- Plan *matplan;
+ Plan *matplan;
matplan = (Plan *) make_material(plan->targetlist, plan);
/* kluge --- see comments above */
@@ -663,8 +663,8 @@ SS_finalize_plan(Plan *plan, List *rtable)
case T_Append:
foreach(lst, ((Append *) plan)->appendplans)
results.paramids = set_unioni(results.paramids,
- SS_finalize_plan((Plan *) lfirst(lst),
- rtable));
+ SS_finalize_plan((Plan *) lfirst(lst),
+ rtable));
break;
case T_NestLoop: