summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r--src/backend/optimizer/util/clauses.c95
-rw-r--r--src/backend/optimizer/util/pathnode.c53
-rw-r--r--src/backend/optimizer/util/placeholder.c18
-rw-r--r--src/backend/optimizer/util/plancat.c16
-rw-r--r--src/backend/optimizer/util/predtest.c19
-rw-r--r--src/backend/optimizer/util/relnode.c6
-rw-r--r--src/backend/optimizer/util/restrictinfo.c16
-rw-r--r--src/backend/optimizer/util/var.c18
8 files changed, 122 insertions, 119 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index c9c7270d2b..75c5d0c94d 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.276 2009/02/25 03:30:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.277 2009/06/11 14:48:59 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -98,8 +98,8 @@ static Expr *simplify_function(Oid funcid,
bool allow_inline,
eval_const_expressions_context *context);
static List *add_function_defaults(List *args, Oid result_type,
- HeapTuple func_tuple,
- eval_const_expressions_context *context);
+ HeapTuple func_tuple,
+ eval_const_expressions_context *context);
static Expr *evaluate_function(Oid funcid,
Oid result_type, int32 result_typmod, List *args,
HeapTuple func_tuple,
@@ -114,9 +114,9 @@ static Node *substitute_actual_parameters_mutator(Node *node,
static void sql_inline_error_callback(void *arg);
static Expr *evaluate_expr(Expr *expr, Oid result_type, int32 result_typmod);
static Query *substitute_actual_srf_parameters(Query *expr,
- int nargs, List *args);
+ int nargs, List *args);
static Node *substitute_actual_srf_parameters_mutator(Node *node,
- substitute_actual_srf_parameters_context *context);
+ substitute_actual_srf_parameters_context *context);
static bool tlist_matches_coltypelist(List *tlist, List *coltypelist);
@@ -612,7 +612,8 @@ find_window_functions_walker(Node *node, WindowFuncLists *lists)
lists->numWindowFuncs++;
/*
- * Complain if the window function's arguments contain window functions
+ * Complain if the window function's arguments contain window
+ * functions
*/
if (contain_window_function((Node *) wfunc->args))
ereport(ERROR,
@@ -1557,8 +1558,8 @@ find_forced_null_vars(Node *node)
/*
* We don't bother considering the OR case, because it's fairly
- * unlikely anyone would write "v1 IS NULL OR v1 IS NULL".
- * Likewise, the NOT case isn't worth expending code on.
+ * unlikely anyone would write "v1 IS NULL OR v1 IS NULL". Likewise,
+ * the NOT case isn't worth expending code on.
*/
if (expr->boolop == AND_EXPR)
{
@@ -1594,7 +1595,7 @@ find_forced_null_var(Node *node)
if (expr->nulltesttype == IS_NULL)
{
- Var *var = (Var *) expr->arg;
+ Var *var = (Var *) expr->arg;
if (var && IsA(var, Var) &&
var->varlevelsup == 0)
@@ -1608,7 +1609,7 @@ find_forced_null_var(Node *node)
if (expr->booltesttype == IS_UNKNOWN)
{
- Var *var = (Var *) expr->arg;
+ Var *var = (Var *) expr->arg;
if (var && IsA(var, Var) &&
var->varlevelsup == 0)
@@ -2013,7 +2014,7 @@ eval_const_expressions(PlannerInfo *root, Node *node)
if (root)
{
context.boundParams = root->glob->boundParams; /* bound Params */
- context.glob = root->glob; /* for inlined-function dependencies */
+ context.glob = root->glob; /* for inlined-function dependencies */
}
else
{
@@ -2453,9 +2454,9 @@ eval_const_expressions_mutator(Node *node,
/*
* CoerceViaIO represents calling the source type's output function
- * then the result type's input function. So, try to simplify it
- * as though it were a stack of two such function calls. First we
- * need to know what the functions are.
+ * then the result type's input function. So, try to simplify it as
+ * though it were a stack of two such function calls. First we need
+ * to know what the functions are.
*/
getTypeOutputInfo(exprType((Node *) arg), &outfunc, &outtypisvarlena);
getTypeInputInfo(expr->resulttype, &infunc, &intypioparam);
@@ -2505,8 +2506,8 @@ eval_const_expressions_mutator(Node *node,
ArrayCoerceExpr *newexpr;
/*
- * Reduce constants in the ArrayCoerceExpr's argument, then build
- * a new ArrayCoerceExpr.
+ * Reduce constants in the ArrayCoerceExpr's argument, then build a
+ * new ArrayCoerceExpr.
*/
arg = (Expr *) eval_const_expressions_mutator((Node *) expr->arg,
context);
@@ -2925,7 +2926,7 @@ eval_const_expressions_mutator(Node *node,
newbtest->booltesttype = btest->booltesttype;
return (Node *) newbtest;
}
- if (IsA(node, PlaceHolderVar) && context->estimate)
+ if (IsA(node, PlaceHolderVar) &&context->estimate)
{
/*
* In estimation mode, just strip the PlaceHolderVar node altogether;
@@ -3266,7 +3267,7 @@ simplify_function(Oid funcid, Oid result_type, int32 result_typmod,
*
* It is possible for some of the defaulted arguments to be polymorphic;
* therefore we can't assume that the default expressions have the correct
- * data types already. We have to re-resolve polymorphics and do coercion
+ * data types already. We have to re-resolve polymorphics and do coercion
* just like the parser did.
*/
static List *
@@ -3594,7 +3595,7 @@ inline_function(Oid funcid, Oid result_type, List *args,
/*
* Make sure the function (still) returns what it's declared to. This
* will raise an error if wrong, but that's okay since the function would
- * fail at runtime anyway. Note that check_sql_fn_retval will also insert
+ * fail at runtime anyway. Note that check_sql_fn_retval will also insert
* a RelabelType if needed to make the tlist expression match the declared
* type of the function.
*
@@ -3695,8 +3696,8 @@ inline_function(Oid funcid, Oid result_type, List *args,
MemoryContextDelete(mycxt);
/*
- * Since there is now no trace of the function in the plan tree, we
- * must explicitly record the plan's dependency on the function.
+ * Since there is now no trace of the function in the plan tree, we must
+ * explicitly record the plan's dependency on the function.
*/
if (context->glob)
record_plan_function_dependency(context->glob, funcid);
@@ -3825,7 +3826,7 @@ evaluate_expr(Expr *expr, Oid result_type, int32 result_typmod)
fix_opfuncids((Node *) expr);
/*
- * Prepare expr for execution. (Note: we can't use ExecPrepareExpr
+ * Prepare expr for execution. (Note: we can't use ExecPrepareExpr
* because it'd result in recursively invoking eval_const_expressions.)
*/
exprstate = ExecInitExpr(expr, NULL);
@@ -3908,10 +3909,10 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
Assert(rte->rtekind == RTE_FUNCTION);
/*
- * It doesn't make a lot of sense for a SQL SRF to refer to itself
- * in its own FROM clause, since that must cause infinite recursion
- * at runtime. It will cause this code to recurse too, so check
- * for stack overflow. (There's no need to do more.)
+ * It doesn't make a lot of sense for a SQL SRF to refer to itself in its
+ * own FROM clause, since that must cause infinite recursion at runtime.
+ * It will cause this code to recurse too, so check for stack overflow.
+ * (There's no need to do more.)
*/
check_stack_depth();
@@ -3922,8 +3923,8 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
/*
* The function must be declared to return a set, else inlining would
- * change the results if the contained SELECT didn't return exactly
- * one row.
+ * change the results if the contained SELECT didn't return exactly one
+ * row.
*/
if (!fexpr->funcretset)
return NULL;
@@ -3932,7 +3933,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
* Refuse to inline if the arguments contain any volatile functions or
* sub-selects. Volatile functions are rejected because inlining may
* result in the arguments being evaluated multiple times, risking a
- * change in behavior. Sub-selects are rejected partly for implementation
+ * change in behavior. Sub-selects are rejected partly for implementation
* reasons (pushing them down another level might change their behavior)
* and partly because they're likely to be expensive and so multiple
* evaluation would be bad.
@@ -3957,7 +3958,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
/*
* Forget it if the function is not SQL-language or has other showstopper
- * properties. In particular it mustn't be declared STRICT, since we
+ * properties. In particular it mustn't be declared STRICT, since we
* couldn't enforce that. It also mustn't be VOLATILE, because that is
* supposed to cause it to be executed with its own snapshot, rather than
* sharing the snapshot of the calling query. (The nargs check is just
@@ -4017,16 +4018,16 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
src = TextDatumGetCString(tmp);
/*
- * Parse, analyze, and rewrite (unlike inline_function(), we can't
- * skip rewriting here). We can fail as soon as we find more than
- * one query, though.
+ * Parse, analyze, and rewrite (unlike inline_function(), we can't skip
+ * rewriting here). We can fail as soon as we find more than one query,
+ * though.
*/
raw_parsetree_list = pg_parse_query(src);
if (list_length(raw_parsetree_list) != 1)
goto fail;
querytree_list = pg_analyze_and_rewrite(linitial(raw_parsetree_list), src,
- argtypes, funcform->pronargs);
+ argtypes, funcform->pronargs);
if (list_length(querytree_list) != 1)
goto fail;
querytree = linitial(querytree_list);
@@ -4043,13 +4044,13 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
/*
* Make sure the function (still) returns what it's declared to. This
* will raise an error if wrong, but that's okay since the function would
- * fail at runtime anyway. Note that check_sql_fn_retval will also insert
+ * fail at runtime anyway. Note that check_sql_fn_retval will also insert
* RelabelType(s) if needed to make the tlist expression(s) match the
* declared type of the function.
*
- * If the function returns a composite type, don't inline unless the
- * check shows it's returning a whole tuple result; otherwise what
- * it's returning is a single composite column which is not what we need.
+ * If the function returns a composite type, don't inline unless the check
+ * shows it's returning a whole tuple result; otherwise what it's
+ * returning is a single composite column which is not what we need.
*/
if (!check_sql_fn_retval(fexpr->funcid, fexpr->funcresulttype,
querytree_list,
@@ -4076,8 +4077,8 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
fexpr->args);
/*
- * Copy the modified query out of the temporary memory context,
- * and clean up.
+ * Copy the modified query out of the temporary memory context, and clean
+ * up.
*/
MemoryContextSwitchTo(oldcxt);
@@ -4088,8 +4089,8 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
ReleaseSysCache(func_tuple);
/*
- * Since there is now no trace of the function in the plan tree, we
- * must explicitly record the plan's dependency on the function.
+ * Since there is now no trace of the function in the plan tree, we must
+ * explicitly record the plan's dependency on the function.
*/
record_plan_function_dependency(root->glob, fexpr->funcid);
@@ -4128,9 +4129,9 @@ substitute_actual_srf_parameters(Query *expr, int nargs, List *args)
static Node *
substitute_actual_srf_parameters_mutator(Node *node,
- substitute_actual_srf_parameters_context *context)
+ substitute_actual_srf_parameters_context *context)
{
- Node *result;
+ Node *result;
if (node == NULL)
return NULL;
@@ -4138,7 +4139,7 @@ substitute_actual_srf_parameters_mutator(Node *node,
{
context->sublevels_up++;
result = (Node *) query_tree_mutator((Query *) node,
- substitute_actual_srf_parameters_mutator,
+ substitute_actual_srf_parameters_mutator,
(void *) context,
0);
context->sublevels_up--;
@@ -4154,8 +4155,8 @@ substitute_actual_srf_parameters_mutator(Node *node,
elog(ERROR, "invalid paramid: %d", param->paramid);
/*
- * Since the parameter is being inserted into a subquery,
- * we must adjust levels.
+ * Since the parameter is being inserted into a subquery, we must
+ * adjust levels.
*/
result = copyObject(list_nth(context->args, param->paramid - 1));
IncrementVarSublevelsUp(result, context->sublevels_up, 0);
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 5ba413bb1a..b0358cb112 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.151 2009/03/26 17:15:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.152 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -797,7 +797,7 @@ create_unique_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
in_operators = NIL;
uniq_exprs = NIL;
all_btree = true;
- all_hash = enable_hashagg; /* don't consider hash if not enabled */
+ all_hash = enable_hashagg; /* don't consider hash if not enabled */
foreach(lc, sjinfo->join_quals)
{
OpExpr *op = (OpExpr *) lfirst(lc);
@@ -904,8 +904,8 @@ create_unique_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
goto no_unique_path;
/*
- * If we get here, we can unique-ify using at least one of sorting
- * and hashing. Start building the result Path object.
+ * If we get here, we can unique-ify using at least one of sorting and
+ * hashing. Start building the result Path object.
*/
pathnode = makeNode(UniquePath);
@@ -972,8 +972,8 @@ create_unique_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
-1.0);
/*
- * Charge one cpu_operator_cost per comparison per input tuple.
- * We assume all columns get compared at most of the tuples. (XXX
+ * Charge one cpu_operator_cost per comparison per input tuple. We
+ * assume all columns get compared at most of the tuples. (XXX
* probably this is an overestimate.) This should agree with
* make_unique.
*/
@@ -1030,7 +1030,7 @@ create_unique_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
return pathnode;
-no_unique_path: /* failure exit */
+no_unique_path: /* failure exit */
/* Mark the SpecialJoinInfo as not unique-able */
sjinfo->join_quals = NIL;
@@ -1404,27 +1404,27 @@ create_mergejoin_path(PlannerInfo *root,
* selected as the input of a mergejoin, and they don't support
* mark/restore at present.
*
- * Note: Sort supports mark/restore, so no materialize is really needed
- * in that case; but one may be desirable anyway to optimize the sort.
- * However, since we aren't representing the sort step separately in
- * the Path tree, we can't explicitly represent the materialize either.
- * So that case is not handled here. Instead, cost_mergejoin has to
- * factor in the cost and create_mergejoin_plan has to add the plan node.
+ * Note: Sort supports mark/restore, so no materialize is really needed in
+ * that case; but one may be desirable anyway to optimize the sort.
+ * However, since we aren't representing the sort step separately in the
+ * Path tree, we can't explicitly represent the materialize either. So
+ * that case is not handled here. Instead, cost_mergejoin has to factor
+ * in the cost and create_mergejoin_plan has to add the plan node.
*/
if (innersortkeys == NIL &&
!ExecSupportsMarkRestore(inner_path->pathtype))
{
- Path *mpath;
+ Path *mpath;
mpath = (Path *) create_material_path(inner_path->parent, inner_path);
/*
- * We expect the materialize won't spill to disk (it could only do
- * so if there were a whole lot of duplicate tuples, which is a case
- * cost_mergejoin will avoid choosing anyway). Therefore
- * cost_material's cost estimate is bogus and we should charge
- * just cpu_tuple_cost per tuple. (Keep this estimate in sync with
- * similar ones in cost_mergejoin and create_mergejoin_plan.)
+ * We expect the materialize won't spill to disk (it could only do so
+ * if there were a whole lot of duplicate tuples, which is a case
+ * cost_mergejoin will avoid choosing anyway). Therefore
+ * cost_material's cost estimate is bogus and we should charge just
+ * cpu_tuple_cost per tuple. (Keep this estimate in sync with similar
+ * ones in cost_mergejoin and create_mergejoin_plan.)
*/
mpath->startup_cost = inner_path->startup_cost;
mpath->total_cost = inner_path->total_cost;
@@ -1480,16 +1480,17 @@ create_hashjoin_path(PlannerInfo *root,
pathnode->jpath.outerjoinpath = outer_path;
pathnode->jpath.innerjoinpath = inner_path;
pathnode->jpath.joinrestrictinfo = restrict_clauses;
+
/*
* A hashjoin never has pathkeys, since its output ordering is
- * unpredictable due to possible batching. XXX If the inner relation is
+ * unpredictable due to possible batching. XXX If the inner relation is
* small enough, we could instruct the executor that it must not batch,
* and then we could assume that the output inherits the outer relation's
- * ordering, which might save a sort step. However there is considerable
- * downside if our estimate of the inner relation size is badly off.
- * For the moment we don't risk it. (Note also that if we wanted to take
- * this seriously, joinpath.c would have to consider many more paths for
- * the outer rel than it does now.)
+ * ordering, which might save a sort step. However there is considerable
+ * downside if our estimate of the inner relation size is badly off. For
+ * the moment we don't risk it. (Note also that if we wanted to take this
+ * seriously, joinpath.c would have to consider many more paths for the
+ * outer rel than it does now.)
*/
pathnode->jpath.path.pathkeys = NIL;
pathnode->path_hashclauses = hashclauses;
diff --git a/src/backend/optimizer/util/placeholder.c b/src/backend/optimizer/util/placeholder.c
index 019352158d..b06c48c1e4 100644
--- a/src/backend/optimizer/util/placeholder.c
+++ b/src/backend/optimizer/util/placeholder.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/placeholder.c,v 1.4 2009/04/19 19:46:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/placeholder.c,v 1.5 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,7 +72,7 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv)
phinfo->ph_var = copyObject(phv);
phinfo->ph_eval_at = pull_varnos((Node *) phv);
/* ph_eval_at may change later, see fix_placeholder_eval_levels */
- phinfo->ph_needed = NULL; /* initially it's unused */
+ phinfo->ph_needed = NULL; /* initially it's unused */
/* for the moment, estimate width using just the datatype info */
phinfo->ph_width = get_typavgwidth(exprType((Node *) phv->phexpr),
exprTypmod((Node *) phv->phexpr));
@@ -88,7 +88,7 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv)
*
* The initial eval_at level set by find_placeholder_info was the set of
* rels used in the placeholder's expression (or the whole subselect if
- * the expr is variable-free). If the subselect contains any outer joins
+ * the expr is variable-free). If the subselect contains any outer joins
* that can null any of those rels, we must delay evaluation to above those
* joins.
*
@@ -153,11 +153,11 @@ fix_placeholder_eval_levels(PlannerInfo *root)
/*
* Now that we know where to evaluate the placeholder, make sure that
* any vars or placeholders it uses will be available at that join
- * level. NOTE: this could cause more PlaceHolderInfos to be added
- * to placeholder_list. That is okay because we'll process them
- * before falling out of the foreach loop. Also, it could cause
- * the ph_needed sets of existing list entries to expand, which
- * is also okay because this loop doesn't examine those.
+ * level. NOTE: this could cause more PlaceHolderInfos to be added to
+ * placeholder_list. That is okay because we'll process them before
+ * falling out of the foreach loop. Also, it could cause the
+ * ph_needed sets of existing list entries to expand, which is also
+ * okay because this loop doesn't examine those.
*/
if (bms_membership(eval_at) == BMS_MULTIPLE)
{
@@ -173,7 +173,7 @@ fix_placeholder_eval_levels(PlannerInfo *root)
* Now, if any placeholder can be computed at a base rel and is needed
* above it, add it to that rel's targetlist. (This is essentially the
* same logic as in add_placeholders_to_joinrel, but we can't do that part
- * until joinrels are formed.) We have to do this as a separate step
+ * until joinrels are formed.) We have to do this as a separate step
* because the ph_needed values aren't stable until the previous loop
* finishes.
*/
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 0479e93ec8..4f07cade68 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.157 2009/05/12 00:56:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.158 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -525,7 +525,7 @@ get_relation_constraints(PlannerInfo *root,
/* Add NOT NULL constraints in expression form, if requested */
if (include_notnull && constr->has_not_null)
{
- int natts = relation->rd_att->natts;
+ int natts = relation->rd_att->natts;
for (i = 1; i <= natts; i++)
{
@@ -533,7 +533,7 @@ get_relation_constraints(PlannerInfo *root,
if (att->attnotnull && !att->attisdropped)
{
- NullTest *ntest = makeNode(NullTest);
+ NullTest *ntest = makeNode(NullTest);
ntest->arg = (Expr *) makeVar(varno,
i,
@@ -604,7 +604,7 @@ relation_excluded_by_constraints(PlannerInfo *root,
return false;
/*
- * OK to fetch the constraint expressions. Include "col IS NOT NULL"
+ * OK to fetch the constraint expressions. Include "col IS NOT NULL"
* expressions for attnotnull columns, in case we can refute those.
*/
constraint_pred = get_relation_constraints(root, rte->relid, rel, true);
@@ -865,10 +865,10 @@ has_unique_index(RelOptInfo *rel, AttrNumber attno)
/*
* Note: ignore partial indexes, since they don't allow us to conclude
* that all attr values are distinct, *unless* they are marked predOK
- * which means we know the index's predicate is satisfied by the query.
- * We don't take any interest in expressional indexes either. Also, a
- * multicolumn unique index doesn't allow us to conclude that just the
- * specified attr is unique.
+ * which means we know the index's predicate is satisfied by the
+ * query. We don't take any interest in expressional indexes either.
+ * Also, a multicolumn unique index doesn't allow us to conclude that
+ * just the specified attr is unique.
*/
if (index->unique &&
index->ncolumns == 1 &&
diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c
index 3249b2726e..2b9f7727d8 100644
--- a/src/backend/optimizer/util/predtest.c
+++ b/src/backend/optimizer/util/predtest.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.26 2009/05/11 17:56:08 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.27 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,7 +98,7 @@ static Node *extract_not_arg(Node *clause);
static bool list_member_strip(List *list, Expr *datum);
static bool btree_predicate_proof(Expr *predicate, Node *clause,
bool refute_it);
-static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it);
+static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it);
static void InvalidateOprProofCacheCallBack(Datum arg, int cacheid, ItemPointer tuplePtr);
@@ -134,7 +134,7 @@ predicate_implied_by(List *predicate_list, List *restrictinfo_list)
/*
* If either input is a single-element list, replace it with its lone
- * member; this avoids one useless level of AND-recursion. We only need
+ * member; this avoids one useless level of AND-recursion. We only need
* to worry about this at top level, since eval_const_expressions should
* have gotten rid of any trivial ANDs or ORs below that.
*/
@@ -192,7 +192,7 @@ predicate_refuted_by(List *predicate_list, List *restrictinfo_list)
/*
* If either input is a single-element list, replace it with its lone
- * member; this avoids one useless level of AND-recursion. We only need
+ * member; this avoids one useless level of AND-recursion. We only need
* to worry about this at top level, since eval_const_expressions should
* have gotten rid of any trivial ANDs or ORs below that.
*/
@@ -652,13 +652,14 @@ predicate_refuted_by_recurse(Node *clause, Node *predicate)
case CLASS_ATOM:
#ifdef NOT_USED
+
/*
* If A is a NOT-clause, A R=> B if B => A's arg
*
* Unfortunately not: this would only prove that B is not-TRUE,
* not that it's not NULL either. Keep this code as a comment
- * because it would be useful if we ever had a need for the
- * weak form of refutation.
+ * because it would be useful if we ever had a need for the weak
+ * form of refutation.
*/
not_arg = extract_not_arg(clause);
if (not_arg &&
@@ -738,7 +739,7 @@ predicate_refuted_by_recurse(Node *clause, Node *predicate)
* This function also implements enforcement of MAX_SAOP_ARRAY_SIZE: if a
* ScalarArrayOpExpr's array has too many elements, we just classify it as an
* atom. (This will result in its being passed as-is to the simple_clause
- * functions, which will fail to prove anything about it.) Note that we
+ * functions, which will fail to prove anything about it.) Note that we
* cannot just stop after considering MAX_SAOP_ARRAY_SIZE elements; in general
* that would result in wrong proofs, rather than failing to prove anything.
*/
@@ -1484,8 +1485,8 @@ typedef struct OprProofCacheEntry
bool have_implic; /* do we know the implication result? */
bool have_refute; /* do we know the refutation result? */
- Oid implic_test_op; /* OID of the operator, or 0 if none */
- Oid refute_test_op; /* OID of the operator, or 0 if none */
+ Oid implic_test_op; /* OID of the operator, or 0 if none */
+ Oid refute_test_op; /* OID of the operator, or 0 if none */
} OprProofCacheEntry;
static HTAB *OprProofCacheHash = NULL;
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
index 2d289cae71..4ca3eeaaf2 100644
--- a/src/backend/optimizer/util/relnode.c
+++ b/src/backend/optimizer/util/relnode.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/relnode.c,v 1.93 2009/01/01 17:23:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/relnode.c,v 1.94 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -430,8 +430,8 @@ build_joinrel_tlist(PlannerInfo *root, RelOptInfo *joinrel,
int ndx;
/*
- * Ignore PlaceHolderVars in the input tlists; we'll make our
- * own decisions about whether to copy them.
+ * Ignore PlaceHolderVars in the input tlists; we'll make our own
+ * decisions about whether to copy them.
*/
if (IsA(origvar, PlaceHolderVar))
continue;
diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimizer/util/restrictinfo.c
index 5b75d2de3b..47086a4bfc 100644
--- a/src/backend/optimizer/util/restrictinfo.c
+++ b/src/backend/optimizer/util/restrictinfo.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.59 2009/05/09 22:51:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.60 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -593,9 +593,9 @@ select_nonredundant_join_clauses(PlannerInfo *root,
* OK because we're only trying to prove we can dispense with some
* join quals; failing to prove that doesn't result in an incorrect
* plan. It's quite unlikely that a join qual could be proven
- * redundant by an index predicate anyway. (Also, if we did manage
- * to prove it, we'd have to have a special case for update targets;
- * see notes about EvalPlanQual testing in create_indexscan_plan().)
+ * redundant by an index predicate anyway. (Also, if we did manage to
+ * prove it, we'd have to have a special case for update targets; see
+ * notes about EvalPlanQual testing in create_indexscan_plan().)
*/
BitmapHeapPath *innerpath = (BitmapHeapPath *) inner_path;
@@ -614,10 +614,10 @@ select_nonredundant_join_clauses(PlannerInfo *root,
}
/*
- * XXX the inner path of a nestloop could also be an append relation
- * whose elements use join quals. However, they might each use different
- * quals; we could only remove join quals that are enforced by all the
- * appendrel members. For the moment we don't bother to try.
+ * XXX the inner path of a nestloop could also be an append relation whose
+ * elements use join quals. However, they might each use different quals;
+ * we could only remove join quals that are enforced by all the appendrel
+ * members. For the moment we don't bother to try.
*/
return restrictinfo_list;
diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c
index cd88c337f1..deb9ef8ebd 100644
--- a/src/backend/optimizer/util/var.c
+++ b/src/backend/optimizer/util/var.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/var.c,v 1.85 2009/04/19 19:46:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/var.c,v 1.86 2009/06/11 14:48:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -71,9 +71,9 @@ static bool pull_varattnos_walker(Node *node, Bitmapset **varattnos);
static bool contain_var_clause_walker(Node *node, void *context);
static bool contain_vars_of_level_walker(Node *node, int *sublevels_up);
static bool locate_var_of_level_walker(Node *node,
- locate_var_of_level_context *context);
+ locate_var_of_level_context *context);
static bool locate_var_of_relation_walker(Node *node,
- locate_var_of_relation_context *context);
+ locate_var_of_relation_context *context);
static bool find_minimum_var_level_walker(Node *node,
find_minimum_var_level_context *context);
static bool pull_var_clause_walker(Node *node,
@@ -318,7 +318,7 @@ contain_vars_of_level_walker(Node *node, int *sublevels_up)
* Find the parse location of any Var of the specified query level.
*
* Returns -1 if no such Var is in the querytree, or if they all have
- * unknown parse location. (The former case is probably caller error,
+ * unknown parse location. (The former case is probably caller error,
* but we don't bother to distinguish it from the latter case.)
*
* Will recurse into sublinks. Also, may be invoked directly on a Query.
@@ -333,7 +333,7 @@ locate_var_of_level(Node *node, int levelsup)
{
locate_var_of_level_context context;
- context.var_location = -1; /* in case we find nothing */
+ context.var_location = -1; /* in case we find nothing */
context.sublevels_up = levelsup;
(void) query_or_expression_tree_walker(node,
@@ -352,7 +352,7 @@ locate_var_of_level_walker(Node *node,
return false;
if (IsA(node, Var))
{
- Var *var = (Var *) node;
+ Var *var = (Var *) node;
if (var->varlevelsup == context->sublevels_up &&
var->location >= 0)
@@ -401,7 +401,7 @@ locate_var_of_relation(Node *node, int relid, int levelsup)
{
locate_var_of_relation_context context;
- context.var_location = -1; /* in case we find nothing */
+ context.var_location = -1; /* in case we find nothing */
context.relid = relid;
context.sublevels_up = levelsup;
@@ -421,7 +421,7 @@ locate_var_of_relation_walker(Node *node,
return false;
if (IsA(node, Var))
{
- Var *var = (Var *) node;
+ Var *var = (Var *) node;
if (var->varno == context->relid &&
var->varlevelsup == context->sublevels_up &&
@@ -625,7 +625,7 @@ find_minimum_var_level_walker(Node *node,
* Upper-level vars (with varlevelsup > 0) are not included.
* (These probably represent errors too, but we don't complain.)
*
- * Returns list of nodes found. Note the nodes themselves are not
+ * Returns list of nodes found. Note the nodes themselves are not
* copied, only referenced.
*
* Does not examine subqueries, therefore must only be used after reduction