summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2025-07-16 13:54:35 +0000
committerRobert Haas2025-07-16 13:54:35 +0000
commitfbaa10ea9ca8ba29c748afbd9e7547d7bc5c9a28 (patch)
tree0ee53605337e1299d1201d521bd1da62b050f62e
parent3643dd3a603836fc3492ef9fbd43e017cd1b1f4d (diff)
reindent
-rw-r--r--contrib/pg_plan_advice/pg_plan_advice.c2
-rw-r--r--contrib/pg_plan_advice/pg_plan_advice.h2
-rw-r--r--contrib/pg_plan_advice/pgpa_collector.h5
-rw-r--r--contrib/pg_plan_advice/pgpa_join.c20
-rw-r--r--contrib/pg_plan_advice/pgpa_output.c30
-rw-r--r--contrib/pg_plan_advice/pgpa_scan.c6
-rw-r--r--contrib/pg_plan_advice/pgpa_walker.c23
-rw-r--r--contrib/pg_plan_advice/pgpa_walker.h2
-rw-r--r--src/tools/pgindent/typedefs.list3
9 files changed, 48 insertions, 45 deletions
diff --git a/contrib/pg_plan_advice/pg_plan_advice.c b/contrib/pg_plan_advice/pg_plan_advice.c
index 03d8e584c4..e61c1f4f69 100644
--- a/contrib/pg_plan_advice/pg_plan_advice.c
+++ b/contrib/pg_plan_advice/pg_plan_advice.c
@@ -27,7 +27,7 @@
PG_MODULE_MAGIC;
-static pgpa_shared_state * pgpa_state = NULL;
+static pgpa_shared_state *pgpa_state = NULL;
static dsa_area *pgpa_dsa_area = NULL;
/* GUC variables */
diff --git a/contrib/pg_plan_advice/pg_plan_advice.h b/contrib/pg_plan_advice/pg_plan_advice.h
index cb4592a76a..385d3f3052 100644
--- a/contrib/pg_plan_advice/pg_plan_advice.h
+++ b/contrib/pg_plan_advice/pg_plan_advice.h
@@ -20,7 +20,7 @@ typedef struct pgpa_shared_state
LWLock lock;
int dsa_tranche;
dsa_handle area;
- dsa_pointer shared_collector;
+ dsa_pointer shared_collector;
} pgpa_shared_state;
/* GUC variables */
diff --git a/contrib/pg_plan_advice/pgpa_collector.h b/contrib/pg_plan_advice/pgpa_collector.h
index fcbad7423b..6f8efa27f0 100644
--- a/contrib/pg_plan_advice/pgpa_collector.h
+++ b/contrib/pg_plan_advice/pgpa_collector.h
@@ -1,4 +1,3 @@
-extern void
-pgpa_collect_advice(uint64 queryId, const char *query_string,
- const char *advice_string);
+extern void pgpa_collect_advice(uint64 queryId, const char *query_string,
+ const char *advice_string);
diff --git a/contrib/pg_plan_advice/pgpa_join.c b/contrib/pg_plan_advice/pgpa_join.c
index 65c13765dc..9bbb5d1932 100644
--- a/contrib/pg_plan_advice/pgpa_join.c
+++ b/contrib/pg_plan_advice/pgpa_join.c
@@ -443,22 +443,22 @@ pgpa_decompose_join(pgpa_plan_walker_context *walker, Plan *plan,
elidedinner = pgpa_descend_node(pstmt, &innerplan);
/*
- * If this is a semijoin that was converted to an inner join by making
- * one side or the other unique, make a note that the inner or outer
- * subplan, as appropriate, should be treated as a query plan feature
- * when the main tree traversal reaches it.
+ * If this is a semijoin that was converted to an inner join by making one
+ * side or the other unique, make a note that the inner or outer subplan,
+ * as appropriate, should be treated as a query plan feature when the main
+ * tree traversal reaches it.
*
* Conversely, if the planner could have made one side of the join unique
- * and thereby converted it to an inner join, and chose not to do so,
- * that is also worth noting. (XXX: I'm not sure that we need to emit
+ * and thereby converted it to an inner join, and chose not to do so, that
+ * is also worth noting. (XXX: I'm not sure that we need to emit
* non-unique advice in every case where these join-type tests pass.)
*
- * NB: This code could appear slightly higher up in in this function,
- * but none of the nodes through which we just descended should be have
+ * NB: This code could appear slightly higher up in in this function, but
+ * none of the nodes through which we just descended should be have
* associated RTIs.
*
- * NB: This seems like a somewhat hacky way of passing information up
- * to the main tree walk, but I don't currently have a better idea.
+ * NB: This seems like a somewhat hacky way of passing information up to
+ * the main tree walk, but I don't currently have a better idea.
*/
if (uniqueouter)
pgpa_add_future_feature(walker, PGPAQF_SEMIJOIN_UNIQUE, outerplan);
diff --git a/contrib/pg_plan_advice/pgpa_output.c b/contrib/pg_plan_advice/pgpa_output.c
index 43b82f028a..bec5b04345 100644
--- a/contrib/pg_plan_advice/pgpa_output.c
+++ b/contrib/pg_plan_advice/pgpa_output.c
@@ -65,7 +65,7 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
*/
foreach(lc, walker->scans)
{
- pgpa_scan *scan = lfirst(lc);
+ pgpa_scan *scan = lfirst(lc);
context.scans[scan->strategy] =
lappend(context.scans[scan->strategy], scan->relids);
@@ -80,10 +80,10 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
* is the driving table which is then joined to "b" then "c" then "d",
* which is totally different from JOIN_ORDER(a b) and JOIN_ORDER(c d).
*
- * As a side effect, the calls to pgpa_output_unrolled_join() will
- * add to the context.unrolled_joins[] lists and context.scans[] lists,
- * which will be important for emitting join and scan strategy advice
- * further down.
+ * As a side effect, the calls to pgpa_output_unrolled_join() will add to
+ * the context.unrolled_joins[] lists and context.scans[] lists, which
+ * will be important for emitting join and scan strategy advice further
+ * down.
*/
foreach(lc, walker->unrolled_joins)
{
@@ -102,8 +102,8 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
*/
for (int s = 0; s < NUM_PGPA_JOIN_STRATEGY; ++s)
{
- char *strategy = pgpa_cstring_join_strategy(s);
- bool first = true;
+ char *strategy = pgpa_cstring_join_strategy(s);
+ bool first = true;
if (context.unrolled_joins[s] == NIL)
continue;
@@ -114,7 +114,7 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
foreach(lc, context.unrolled_joins[s])
{
- Bitmapset *relids = lfirst(lc);
+ Bitmapset *relids = lfirst(lc);
if (first)
first = false;
@@ -143,15 +143,15 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
* XXX. It's not entirely clear that emitting DEGENERATE() advice is
* useful at all, since there is no real decision to be made: you can't
* decide whether or not something is provably empty. On the other hand,
- * it might be useful to human beings even if the computer doesn't need it.
- * FOREIGN() and PARTITIONWISE() are clearly useful, but they are scan
+ * it might be useful to human beings even if the computer doesn't need
+ * it. FOREIGN() and PARTITIONWISE() are clearly useful, but they are scan
* types as well as join types, and the question of how to handle that
* deserves more thought.
*/
for (int c = 0; c < NUM_PGPA_SCAN_STRATEGY; ++c)
{
- char *cstrategy = pgpa_cstring_scan_strategy(c);
- bool first = true;
+ char *cstrategy = pgpa_cstring_scan_strategy(c);
+ bool first = true;
if (context.scans[c] == NIL)
continue;
@@ -162,7 +162,7 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
foreach(lc, context.scans[c])
{
- Bitmapset *relids = lfirst(lc);
+ Bitmapset *relids = lfirst(lc);
if (first)
first = false;
@@ -194,7 +194,7 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker,
*/
for (int t = 0; t < NUM_PGPA_QF_TYPES; ++t)
{
- bool first = true;
+ bool first = true;
if (context.query_features[t] == NIL)
continue;
@@ -289,7 +289,7 @@ pgpa_output_join_member(pgpa_output_context *context,
{
if (member->clump_join != NULL)
{
- pgpa_scan *scan = member->clump_join;
+ pgpa_scan *scan = member->clump_join;
appendStringInfoChar(context->buf, '{');
pgpa_output_relations(context, context->buf, scan->relids);
diff --git a/contrib/pg_plan_advice/pgpa_scan.c b/contrib/pg_plan_advice/pgpa_scan.c
index 71e982f7e8..8865773b68 100644
--- a/contrib/pg_plan_advice/pgpa_scan.c
+++ b/contrib/pg_plan_advice/pgpa_scan.c
@@ -26,9 +26,9 @@
pgpa_scan *
pgpa_build_scan(PlannedStmt *pstmt, Plan *plan, ElidedNode *elided_node)
{
- pgpa_scan *scan = palloc(sizeof(pgpa_scan));
- Bitmapset *relids = NULL;
- int rti = -1;
+ pgpa_scan *scan = palloc(sizeof(pgpa_scan));
+ Bitmapset *relids = NULL;
+ int rti = -1;
scan->plan = plan;
diff --git a/contrib/pg_plan_advice/pgpa_walker.c b/contrib/pg_plan_advice/pgpa_walker.c
index 51c1ba7463..597bb3098c 100644
--- a/contrib/pg_plan_advice/pgpa_walker.c
+++ b/contrib/pg_plan_advice/pgpa_walker.c
@@ -39,9 +39,9 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
* If this is a Gather or Gather Merge node, directly add it to the list
* of currently-active query features.
*
- * Otherwise, check the future_query_features list to see whether this
- * was previously identified as a plan node that needs to be treated as
- * a query feature.
+ * Otherwise, check the future_query_features list to see whether this was
+ * previously identified as a plan node that needs to be treated as a
+ * query feature.
*/
if (IsA(plan, Gather))
{
@@ -111,7 +111,7 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
{
if (bms_membership(n->relids) == BMS_MULTIPLE)
{
- pgpa_scan *scan;
+ pgpa_scan *scan;
scan = pgpa_build_scan(walker->pstmt, plan, n);
walker->scans = lappend(walker->scans, scan);
@@ -123,9 +123,9 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
* considered as part of the same join problem, nodes elided during
* setrefs processing act as boundaries.
*
- * In more detail, if an Append or MergeAppend was elided, then j
- * a partitionwise join was chosen and only a single child survived;
- * if a SubqueryScan was elided, the subquery was separately without
+ * In more detail, if an Append or MergeAppend was elided, then j a
+ * partitionwise join was chosen and only a single child survived; if
+ * a SubqueryScan was elided, the subquery was separately without
* flattening it into the parent. In either case, the join order and
* join methods beneath the elided node should be described separately
* from the join order and methods above the elided node.
@@ -154,7 +154,7 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
*/
if (class == PGPA_CLUMPED_JOIN && join_unroll_level == 0)
{
- pgpa_scan *scan;
+ pgpa_scan *scan;
scan = pgpa_build_scan(walker->pstmt, plan, NULL);
walker->scans = lappend(walker->scans, scan);
@@ -202,7 +202,7 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
{
case T_Append:
{
- Append *aplan = (Append *) plan;
+ Append *aplan = (Append *) plan;
extraplans = aplan->appendplans;
pushdown_query_features = bms_is_empty(aplan->apprelids);
@@ -223,6 +223,7 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
extraplans = ((BitmapOr *) plan)->bitmapplans;
break;
case T_SubqueryScan:
+
/*
* We don't pass down active_query_features across here, because
* those are specific to a subquery level.
@@ -259,7 +260,7 @@ pgpa_plan_walker(pgpa_plan_walker_context *walker, Plan *plan,
*/
if (is_query_feature)
{
- int num_aqf = list_length(active_query_features);
+ int num_aqf = list_length(active_query_features);
(void) list_truncate(active_query_features, num_aqf - 1);
}
@@ -413,7 +414,7 @@ static void
pgpa_qf_add_plan_rtis(List *active_query_features, Plan *plan)
{
Bitmapset *relids;
- Index rti;
+ Index rti;
if ((relids = pgpa_relids(plan)) != NULL)
pgpa_qf_add_rtis(active_query_features, relids);
diff --git a/contrib/pg_plan_advice/pgpa_walker.h b/contrib/pg_plan_advice/pgpa_walker.h
index d052563d2f..871d31801d 100644
--- a/contrib/pg_plan_advice/pgpa_walker.h
+++ b/contrib/pg_plan_advice/pgpa_walker.h
@@ -56,7 +56,7 @@ typedef enum pgpa_qf_type
*/
typedef struct pgpa_query_feature
{
- pgpa_qf_type type;
+ pgpa_qf_type type;
Plan *plan;
Bitmapset *relids;
} pgpa_query_feature;
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 2e2ee9aa98..9efec94efb 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -4320,8 +4320,11 @@ pgpa_local_advice
pgpa_local_advice_chunk
pgpa_output_context
pgpa_plan_walker_context
+pgpa_qf_type
+pgpa_query_feature
pgpa_scan
pgpa_scan_strategy
pgpa_shared_advice
pgpa_shared_advice_chunk
+pgpa_shared_state
pgpa_unrolled_join