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.c16
-rw-r--r--src/backend/optimizer/util/orclauses.c2
-rw-r--r--src/backend/optimizer/util/pathnode.c35
-rw-r--r--src/backend/optimizer/util/placeholder.c2
-rw-r--r--src/backend/optimizer/util/plancat.c6
-rw-r--r--src/backend/optimizer/util/predtest.c52
-rw-r--r--src/backend/optimizer/util/relnode.c8
-rw-r--r--src/backend/optimizer/util/restrictinfo.c4
-rw-r--r--src/backend/optimizer/util/tlist.c12
-rw-r--r--src/backend/optimizer/util/var.c4
10 files changed, 70 insertions, 71 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index a1dafc8e0f..b9e5dc25eb 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -1399,7 +1399,7 @@ contain_context_dependent_node(Node *clause)
return contain_context_dependent_node_walker(clause, &flags);
}
-#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
+#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
static bool
contain_context_dependent_node_walker(Node *node, int *flags)
@@ -2434,7 +2434,7 @@ estimate_expression_value(PlannerInfo *root, Node *node)
{
eval_const_expressions_context context;
- context.boundParams = root->glob->boundParams; /* bound Params */
+ context.boundParams = root->glob->boundParams; /* bound Params */
/* we do not need to mark the plan as depending on inlined functions */
context.root = NULL;
context.active_fns = NIL; /* nothing being recursively simplified */
@@ -2712,8 +2712,8 @@ eval_const_expressions_mutator(Node *node,
* Need to get OID of underlying function. Okay to
* scribble on input to this extent.
*/
- set_opfuncid((OpExpr *) expr); /* rely on struct
- * equivalence */
+ set_opfuncid((OpExpr *) expr); /* rely on struct
+ * equivalence */
/*
* Code for op/func reduction is pretty bulky, so split it
@@ -3114,7 +3114,7 @@ eval_const_expressions_mutator(Node *node,
if (newarg && IsA(newarg, Const))
{
context->case_val = newarg;
- newarg = NULL; /* not needed anymore, see above */
+ newarg = NULL; /* not needed anymore, see above */
}
else
context->case_val = NULL;
@@ -3463,7 +3463,7 @@ eval_const_expressions_mutator(Node *node,
default:
elog(ERROR, "unrecognized nulltesttype: %d",
(int) ntest->nulltesttype);
- result = false; /* keep compiler quiet */
+ result = false; /* keep compiler quiet */
break;
}
@@ -3517,7 +3517,7 @@ eval_const_expressions_mutator(Node *node,
default:
elog(ERROR, "unrecognized booltesttype: %d",
(int) btest->booltesttype);
- result = false; /* keep compiler quiet */
+ result = false; /* keep compiler quiet */
break;
}
@@ -4263,7 +4263,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod,
newexpr->funcretset = false;
newexpr->funcvariadic = funcvariadic;
newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
- newexpr->funccollid = result_collid; /* doesn't matter */
+ newexpr->funccollid = result_collid; /* doesn't matter */
newexpr->inputcollid = input_collid;
newexpr->args = args;
newexpr->location = -1;
diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c
index b6867e3001..dd7cfc94b8 100644
--- a/src/backend/optimizer/util/orclauses.c
+++ b/src/backend/optimizer/util/orclauses.c
@@ -84,7 +84,7 @@ extract_restriction_or_clauses(PlannerInfo *root)
if (rel == NULL)
continue;
- Assert(rel->relid == rti); /* sanity check on array */
+ Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index ec4a093d9f..63afc04b62 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -411,7 +411,7 @@ set_cheapest(RelOptInfo *parent_rel)
void
add_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
List *new_path_pathkeys;
ListCell *p1;
@@ -484,7 +484,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
else if (keyscmp == PATHKEYS_BETTER2)
{
@@ -492,7 +492,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
else /* keyscmp == PATHKEYS_EQUAL */
{
@@ -534,11 +534,11 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
else if (outercmp == BMS_SUBSET1 &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
else if (outercmp == BMS_SUBSET2 &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
/* else different parameterizations, keep both */
}
break;
@@ -551,7 +551,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
break;
case COSTS_BETTER2:
@@ -563,7 +563,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
break;
case COSTS_DIFFERENT:
@@ -751,7 +751,7 @@ add_path_precheck(RelOptInfo *parent_rel,
void
add_partial_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
ListCell *p1;
ListCell *p1_prev;
@@ -1081,7 +1081,7 @@ create_bitmap_heap_path(PlannerInfo *root,
pathnode->path.parallel_aware = parallel_degree > 0 ? true : false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_degree;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapqual = bitmapqual;
@@ -1118,7 +1118,7 @@ create_bitmap_and_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@@ -1154,7 +1154,7 @@ create_bitmap_or_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@@ -1182,7 +1182,7 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->tidquals = tidquals;
@@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers;
- pathnode->path.pathkeys = NIL; /* result is always considered
- * unsorted */
+ pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths;
@@ -1311,7 +1310,7 @@ create_merge_append_path(PlannerInfo *root,
else
{
/* We'll need to insert a Sort node, so include cost for that */
- Path sort_path; /* dummy for result of cost_sort */
+ Path sort_path; /* dummy for result of cost_sort */
cost_sort(&sort_path,
root,
@@ -1743,7 +1742,7 @@ create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = false;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* Gather has unordered result */
+ pathnode->path.pathkeys = NIL; /* Gather has unordered result */
pathnode->subpath = subpath;
pathnode->num_workers = subpath->parallel_workers;
@@ -2818,8 +2817,8 @@ create_groupingsets_path(PlannerInfo *root,
}
else
{
- Path sort_path; /* dummy for result of cost_sort */
- Path agg_path; /* dummy for result of cost_agg */
+ Path sort_path; /* dummy for result of cost_sort */
+ Path agg_path; /* dummy for result of cost_agg */
if (rollup->is_hashed || is_first_sort)
{
diff --git a/src/backend/optimizer/util/placeholder.c b/src/backend/optimizer/util/placeholder.c
index 698a387ac2..970542dde5 100644
--- a/src/backend/optimizer/util/placeholder.c
+++ b/src/backend/optimizer/util/placeholder.c
@@ -101,7 +101,7 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv,
rels_used = pull_varnos((Node *) phv->phexpr);
phinfo->ph_lateral = bms_difference(rels_used, phv->phrels);
if (bms_is_empty(phinfo->ph_lateral))
- phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
+ phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
phinfo->ph_eval_at = bms_int_members(rels_used, phv->phrels);
/* If no contained vars, force evaluation at syntactic location */
if (bms_is_empty(phinfo->ph_eval_at))
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 939045dc41..9dc35c1aef 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -354,8 +354,8 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
/* Build targetlist using the completed indexprs data */
info->indextlist = build_index_tlist(root, info, relation);
- info->indrestrictinfo = NIL; /* set later, in indxpath.c */
- info->predOK = false; /* set later, in indxpath.c */
+ info->indrestrictinfo = NIL; /* set later, in indxpath.c */
+ info->predOK = false; /* set later, in indxpath.c */
info->unique = index->indisunique;
info->immediate = index->indimmediate;
info->hypothetical = false;
@@ -827,7 +827,7 @@ infer_collation_opclass_match(InferenceElem *elem, Relation idxRel,
List *idxExprs)
{
AttrNumber natt;
- Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
+ Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
Oid inferopcinputtype = InvalidOid; /* OID of opclass input type */
int nplain = 0; /* # plain attrs observed */
diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c
index 72d70d52d1..536d24b698 100644
--- a/src/backend/optimizer/util/predtest.c
+++ b/src/backend/optimizer/util/predtest.c
@@ -382,7 +382,7 @@ predicate_implied_by_recurse(Node *clause, Node *predicate,
iterate_end(pred_info);
if (!presult)
{
- result = false; /* doesn't imply any of B's */
+ result = false; /* doesn't imply any of B's */
break;
}
}
@@ -650,7 +650,7 @@ predicate_refuted_by_recurse(Node *clause, Node *predicate,
iterate_end(pred_info);
if (!presult)
{
- result = false; /* citem refutes nothing */
+ result = false; /* citem refutes nothing */
break;
}
}
@@ -1360,12 +1360,12 @@ static const bool BT_implies_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {TRUE, TRUE, none, none, none, TRUE}, /* LT */
- {none, TRUE, none, none, none, none}, /* LE */
- {none, TRUE, TRUE, TRUE, none, none}, /* EQ */
- {none, none, none, TRUE, none, none}, /* GE */
- {none, none, none, TRUE, TRUE, TRUE}, /* GT */
- {none, none, none, none, none, TRUE} /* NE */
+ {TRUE, TRUE, none, none, none, TRUE}, /* LT */
+ {none, TRUE, none, none, none, none}, /* LE */
+ {none, TRUE, TRUE, TRUE, none, none}, /* EQ */
+ {none, none, none, TRUE, none, none}, /* GE */
+ {none, none, none, TRUE, TRUE, TRUE}, /* GT */
+ {none, none, none, none, none, TRUE} /* NE */
};
static const bool BT_refutes_table[6][6] = {
@@ -1373,12 +1373,12 @@ static const bool BT_refutes_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {none, none, TRUE, TRUE, TRUE, none}, /* LT */
- {none, none, none, none, TRUE, none}, /* LE */
- {TRUE, none, none, none, TRUE, TRUE}, /* EQ */
- {TRUE, none, none, none, none, none}, /* GE */
- {TRUE, TRUE, TRUE, none, none, none}, /* GT */
- {none, none, TRUE, none, none, none} /* NE */
+ {none, none, TRUE, TRUE, TRUE, none}, /* LT */
+ {none, none, none, none, TRUE, none}, /* LE */
+ {TRUE, none, none, none, TRUE, TRUE}, /* EQ */
+ {TRUE, none, none, none, none, none}, /* GE */
+ {TRUE, TRUE, TRUE, none, none, none}, /* GT */
+ {none, none, TRUE, none, none, none} /* NE */
};
static const StrategyNumber BT_implic_table[6][6] = {
@@ -1386,12 +1386,12 @@ static const StrategyNumber BT_implic_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {BTGE, BTGE, none, none, none, BTGE}, /* LT */
- {BTGT, BTGE, none, none, none, BTGT}, /* LE */
- {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
- {none, none, none, BTLE, BTLT, BTLT}, /* GE */
- {none, none, none, BTLE, BTLE, BTLE}, /* GT */
- {none, none, none, none, none, BTEQ} /* NE */
+ {BTGE, BTGE, none, none, none, BTGE}, /* LT */
+ {BTGT, BTGE, none, none, none, BTGT}, /* LE */
+ {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
+ {none, none, none, BTLE, BTLT, BTLT}, /* GE */
+ {none, none, none, BTLE, BTLE, BTLE}, /* GT */
+ {none, none, none, none, none, BTEQ} /* NE */
};
static const StrategyNumber BT_refute_table[6][6] = {
@@ -1399,12 +1399,12 @@ static const StrategyNumber BT_refute_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {none, none, BTGE, BTGE, BTGE, none}, /* LT */
- {none, none, BTGT, BTGT, BTGE, none}, /* LE */
- {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
- {BTLE, BTLT, BTLT, none, none, none}, /* GE */
- {BTLE, BTLE, BTLE, none, none, none}, /* GT */
- {none, none, BTEQ, none, none, none} /* NE */
+ {none, none, BTGE, BTGE, BTGE, none}, /* LT */
+ {none, none, BTGT, BTGT, BTGE, none}, /* LE */
+ {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
+ {BTLE, BTLT, BTLT, none, none, none}, /* GE */
+ {BTLE, BTLE, BTLE, none, none, none}, /* GT */
+ {none, none, BTEQ, none, none, none} /* NE */
};
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
index 76a3868fa0..22f5ddac58 100644
--- a/src/backend/optimizer/util/relnode.c
+++ b/src/backend/optimizer/util/relnode.c
@@ -108,8 +108,8 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
rel->rows = 0;
/* cheap startup cost is interesting iff not all tuples to be retrieved */
rel->consider_startup = (root->tuple_fraction > 0);
- rel->consider_param_startup = false; /* might get changed later */
- rel->consider_parallel = false; /* might get changed later */
+ rel->consider_param_startup = false; /* might get changed later */
+ rel->consider_parallel = false; /* might get changed later */
rel->reltarget = create_empty_pathtarget();
rel->pathlist = NIL;
rel->ppilist = NIL;
@@ -132,7 +132,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
rel->allvisfrac = 0;
rel->subroot = NULL;
rel->subplan_params = NIL;
- rel->rel_parallel_workers = -1; /* set up in get_relation_info */
+ rel->rel_parallel_workers = -1; /* set up in get_relation_info */
rel->serverid = InvalidOid;
rel->userid = rte->checkAsUser;
rel->useridiscurrent = false;
@@ -944,7 +944,7 @@ fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind, Relids relids)
/* cheap startup cost is interesting iff not all tuples to be retrieved */
upperrel->consider_startup = (root->tuple_fraction > 0);
upperrel->consider_param_startup = false;
- upperrel->consider_parallel = false; /* might get changed later */
+ upperrel->consider_parallel = false; /* might get changed later */
upperrel->reltarget = create_empty_pathtarget();
upperrel->pathlist = NIL;
upperrel->cheapest_startup_path = NULL;
diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimizer/util/restrictinfo.c
index e946290af5..ebae0cd8ce 100644
--- a/src/backend/optimizer/util/restrictinfo.c
+++ b/src/backend/optimizer/util/restrictinfo.c
@@ -114,7 +114,7 @@ make_restrictinfo_internal(Expr *clause,
restrictinfo->is_pushed_down = is_pushed_down;
restrictinfo->outerjoin_delayed = outerjoin_delayed;
restrictinfo->pseudoconstant = pseudoconstant;
- restrictinfo->can_join = false; /* may get set below */
+ restrictinfo->can_join = false; /* may get set below */
restrictinfo->security_level = security_level;
restrictinfo->outer_relids = outer_relids;
restrictinfo->nullable_relids = nullable_relids;
@@ -127,7 +127,7 @@ make_restrictinfo_internal(Expr *clause,
if (security_level > 0)
restrictinfo->leakproof = !contain_leaked_vars((Node *) clause);
else
- restrictinfo->leakproof = false; /* really, "don't know" */
+ restrictinfo->leakproof = false; /* really, "don't know" */
/*
* If it's a binary opclause, set up left/right relids info. In any case
diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c
index 09523853d0..9345891380 100644
--- a/src/backend/optimizer/util/tlist.c
+++ b/src/backend/optimizer/util/tlist.c
@@ -28,12 +28,12 @@
/* Workspace for split_pathtarget_walker */
typedef struct
{
- List *input_target_exprs; /* exprs available from input */
+ List *input_target_exprs; /* exprs available from input */
List *level_srfs; /* list of lists of SRF exprs */
- List *level_input_vars; /* vars needed by SRFs of each level */
- List *level_input_srfs; /* SRFs needed by SRFs of each level */
- List *current_input_vars; /* vars needed in current subexpr */
- List *current_input_srfs; /* SRFs needed in current subexpr */
+ List *level_input_vars; /* vars needed by SRFs of each level */
+ List *level_input_srfs; /* SRFs needed by SRFs of each level */
+ List *current_input_vars; /* vars needed in current subexpr */
+ List *current_input_srfs; /* SRFs needed in current subexpr */
int current_depth; /* max SRF depth in current subexpr */
} split_pathtarget_context;
@@ -145,7 +145,7 @@ add_to_flat_tlist(List *tlist, List *exprs)
{
TargetEntry *tle;
- tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
+ tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
next_resno++,
NULL,
false);
diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c
index cf326ae003..45fa22f918 100644
--- a/src/backend/optimizer/util/var.c
+++ b/src/backend/optimizer/util/var.c
@@ -62,8 +62,8 @@ typedef struct
{
PlannerInfo *root;
int sublevels_up;
- bool possible_sublink; /* could aliases include a SubLink? */
- bool inserted_sublink; /* have we inserted a SubLink? */
+ bool possible_sublink; /* could aliases include a SubLink? */
+ bool inserted_sublink; /* have we inserted a SubLink? */
} flatten_join_alias_vars_context;
static bool pull_varnos_walker(Node *node,