Commit de94e2af authored by Tom Lane's avatar Tom Lane

Run pgindent on a batch of (mostly-planner-related) source files.

Getting annoyed at the amount of unrelated chatter I get from pgindent'ing
Rowley's unique-joins patch.  Re-indent all the files it touches.
parent d25379eb
...@@ -2101,8 +2101,8 @@ postgresPlanDirectModify(PlannerInfo *root, ...@@ -2101,8 +2101,8 @@ postgresPlanDirectModify(PlannerInfo *root,
int col; int col;
/* /*
* We transmit only columns that were explicitly targets of the UPDATE, * We transmit only columns that were explicitly targets of the
* so as to avoid unnecessary data transmission. * UPDATE, so as to avoid unnecessary data transmission.
*/ */
col = -1; col = -1;
while ((col = bms_next_member(rte->updatedCols, col)) >= 0) while ((col = bms_next_member(rte->updatedCols, col)) >= 0)
...@@ -3911,10 +3911,10 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, ...@@ -3911,10 +3911,10 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
List *otherclauses; List *otherclauses;
/* /*
* Core code may call GetForeignJoinPaths hook even when the join * Core code may call GetForeignJoinPaths hook even when the join relation
* relation doesn't have a valid user mapping associated with it. See * doesn't have a valid user mapping associated with it. See
* build_join_rel() for details. We can't push down such join, since * build_join_rel() for details. We can't push down such join, since there
* there doesn't exist a user mapping which can be used to connect to the * doesn't exist a user mapping which can be used to connect to the
* foreign server. * foreign server.
*/ */
if (!OidIsValid(joinrel->umid)) if (!OidIsValid(joinrel->umid))
......
...@@ -1671,6 +1671,7 @@ show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es) ...@@ -1671,6 +1671,7 @@ show_plan_tlist(PlanState *planstate, List *ancestors, ExplainState *es)
return; return;
if (IsA(plan, RecursiveUnion)) if (IsA(plan, RecursiveUnion))
return; return;
/* /*
* Likewise for ForeignScan that executes a direct INSERT/UPDATE/DELETE * Likewise for ForeignScan that executes a direct INSERT/UPDATE/DELETE
* *
......
...@@ -373,8 +373,8 @@ try_partial_nestloop_path(PlannerInfo *root, ...@@ -373,8 +373,8 @@ try_partial_nestloop_path(PlannerInfo *root,
} }
/* /*
* Before creating a path, get a quick lower bound on what it is likely * Before creating a path, get a quick lower bound on what it is likely to
* to cost. Bail out right away if it looks terrible. * cost. Bail out right away if it looks terrible.
*/ */
initial_cost_nestloop(root, &workspace, jointype, initial_cost_nestloop(root, &workspace, jointype,
outer_path, inner_path, outer_path, inner_path,
...@@ -571,8 +571,8 @@ try_partial_hashjoin_path(PlannerInfo *root, ...@@ -571,8 +571,8 @@ try_partial_hashjoin_path(PlannerInfo *root,
} }
/* /*
* Before creating a path, get a quick lower bound on what it is likely * Before creating a path, get a quick lower bound on what it is likely to
* to cost. Bail out right away if it looks terrible. * cost. Bail out right away if it looks terrible.
*/ */
initial_cost_hashjoin(root, &workspace, jointype, hashclauses, initial_cost_hashjoin(root, &workspace, jointype, hashclauses,
outer_path, inner_path, outer_path, inner_path,
...@@ -1189,11 +1189,11 @@ match_unsorted_outer(PlannerInfo *root, ...@@ -1189,11 +1189,11 @@ match_unsorted_outer(PlannerInfo *root,
} }
/* /*
* If the joinrel is parallel-safe and the join type supports nested loops, * If the joinrel is parallel-safe and the join type supports nested
* we may be able to consider a partial nestloop plan. However, we can't * loops, we may be able to consider a partial nestloop plan. However, we
* handle JOIN_UNIQUE_OUTER, because the outer path will be partial, and * can't handle JOIN_UNIQUE_OUTER, because the outer path will be partial,
* therefore we won't be able to properly guarantee uniqueness. Nor can * and therefore we won't be able to properly guarantee uniqueness. Nor
* we handle extra_lateral_rels, since partial paths must not be * can we handle extra_lateral_rels, since partial paths must not be
* parameterized. * parameterized.
*/ */
if (joinrel->consider_parallel && nestjoinOK && if (joinrel->consider_parallel && nestjoinOK &&
...@@ -1235,10 +1235,10 @@ consider_parallel_nestloop(PlannerInfo *root, ...@@ -1235,10 +1235,10 @@ consider_parallel_nestloop(PlannerInfo *root,
outerpath->pathkeys); outerpath->pathkeys);
/* /*
* Try the cheapest parameterized paths; only those which will * Try the cheapest parameterized paths; only those which will produce
* produce an unparameterized path when joined to this outerrel * an unparameterized path when joined to this outerrel will survive
* will survive try_partial_nestloop_path. The cheapest * try_partial_nestloop_path. The cheapest unparameterized path is
* unparameterized path is also in this list. * also in this list.
*/ */
foreach(lc2, innerrel->cheapest_parameterized_paths) foreach(lc2, innerrel->cheapest_parameterized_paths)
{ {
...@@ -1250,9 +1250,10 @@ consider_parallel_nestloop(PlannerInfo *root, ...@@ -1250,9 +1250,10 @@ consider_parallel_nestloop(PlannerInfo *root,
/* /*
* Like match_unsorted_outer, we only consider a single nestloop * Like match_unsorted_outer, we only consider a single nestloop
* path when the jointype is JOIN_UNIQUE_INNER. But we have to scan * path when the jointype is JOIN_UNIQUE_INNER. But we have to
* cheapest_parameterized_paths to find the one we want to consider, * scan cheapest_parameterized_paths to find the one we want to
* because cheapest_total_path might not be parallel-safe. * consider, because cheapest_total_path might not be
* parallel-safe.
*/ */
if (jointype == JOIN_UNIQUE_INNER) if (jointype == JOIN_UNIQUE_INNER)
{ {
......
...@@ -70,10 +70,10 @@ query_planner(PlannerInfo *root, List *tlist, ...@@ -70,10 +70,10 @@ query_planner(PlannerInfo *root, List *tlist,
final_rel = build_empty_join_rel(root); final_rel = build_empty_join_rel(root);
/* /*
* If query allows parallelism in general, check whether the quals * If query allows parallelism in general, check whether the quals are
* are parallel-restricted. There's currently no real benefit to * parallel-restricted. There's currently no real benefit to setting
* setting this flag correctly because we can't yet reference subplans * this flag correctly because we can't yet reference subplans from
* from parallel workers. But that might change someday, so set this * parallel workers. But that might change someday, so set this
* correctly anyway. * correctly anyway.
*/ */
if (root->glob->parallelModeOK) if (root->glob->parallelModeOK)
......
...@@ -175,8 +175,8 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind) ...@@ -175,8 +175,8 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind)
/* /*
* This should match what ExecCheckRTEPerms() does. * This should match what ExecCheckRTEPerms() does.
* *
* Note that if the plan ends up depending on the user OID in any * Note that if the plan ends up depending on the user OID in any way
* way - e.g. if it depends on the computed user mapping OID - we must * - e.g. if it depends on the computed user mapping OID - we must
* ensure that it gets invalidated in the case of a user OID change. * ensure that it gets invalidated in the case of a user OID change.
* See RevalidateCachedQuery and more generally the hasForeignJoin * See RevalidateCachedQuery and more generally the hasForeignJoin
* flags in PlannerGlobal and PlannedStmt. * flags in PlannerGlobal and PlannedStmt.
...@@ -434,16 +434,16 @@ build_join_rel(PlannerInfo *root, ...@@ -434,16 +434,16 @@ build_join_rel(PlannerInfo *root,
/* /*
* Set up foreign-join fields if outer and inner relation are foreign * Set up foreign-join fields if outer and inner relation are foreign
* tables (or joins) belonging to the same server and using the same * tables (or joins) belonging to the same server and using the same user
* user mapping. * mapping.
* *
* Otherwise those fields are left invalid, so FDW API will not be called * Otherwise those fields are left invalid, so FDW API will not be called
* for the join relation. * for the join relation.
* *
* For FDWs like file_fdw, which ignore user mapping, the user mapping id * For FDWs like file_fdw, which ignore user mapping, the user mapping id
* associated with the joining relation may be invalid. A valid serverid * associated with the joining relation may be invalid. A valid serverid
* distinguishes between a pushed down join with no user mapping and * distinguishes between a pushed down join with no user mapping and a
* a join which can not be pushed down because of user mapping mismatch. * join which can not be pushed down because of user mapping mismatch.
*/ */
if (OidIsValid(outer_rel->serverid) && if (OidIsValid(outer_rel->serverid) &&
inner_rel->serverid == outer_rel->serverid && inner_rel->serverid == outer_rel->serverid &&
......
...@@ -1887,7 +1887,7 @@ flatten_grouping_sets(Node *expr, bool toplevel, bool *hasGroupingSets) ...@@ -1887,7 +1887,7 @@ flatten_grouping_sets(Node *expr, bool toplevel, bool *hasGroupingSets)
Node *n2 = flatten_grouping_sets(n1, false, NULL); Node *n2 = flatten_grouping_sets(n1, false, NULL);
if (IsA(n1, GroupingSet) && if (IsA(n1, GroupingSet) &&
((GroupingSet *)n1)->kind == GROUPING_SET_SETS) ((GroupingSet *) n1)->kind == GROUPING_SET_SETS)
{ {
result_set = list_concat(result_set, (List *) n2); result_set = list_concat(result_set, (List *) n2);
} }
......
...@@ -524,7 +524,8 @@ typedef struct RelOptInfo ...@@ -524,7 +524,8 @@ typedef struct RelOptInfo
/* Information about foreign tables and foreign joins */ /* Information about foreign tables and foreign joins */
Oid serverid; /* identifies server for the table or join */ Oid serverid; /* identifies server for the table or join */
Oid umid; /* identifies user mapping for the table or join */ Oid umid; /* identifies user mapping for the table or
* join */
/* use "struct FdwRoutine" to avoid including fdwapi.h here */ /* use "struct FdwRoutine" to avoid including fdwapi.h here */
struct FdwRoutine *fdwroutine; struct FdwRoutine *fdwroutine;
void *fdw_private; void *fdw_private;
......
...@@ -55,6 +55,7 @@ extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual, ...@@ -55,6 +55,7 @@ extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
extern Plan *materialize_finished_plan(Plan *subplan); extern Plan *materialize_finished_plan(Plan *subplan);
extern bool is_projection_capable_path(Path *path); extern bool is_projection_capable_path(Path *path);
extern bool is_projection_capable_plan(Plan *plan); extern bool is_projection_capable_plan(Plan *plan);
/* External use of these functions is deprecated: */ /* External use of these functions is deprecated: */
extern Sort *make_sort_from_sortclauses(List *sortcls, Plan *lefttree); extern Sort *make_sort_from_sortclauses(List *sortcls, Plan *lefttree);
extern Agg *make_agg(List *tlist, List *qual, AggStrategy aggstrategy, extern Agg *make_agg(List *tlist, List *qual, AggStrategy aggstrategy,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment