reindent
authorRobert Haas <rhaas@postgresql.org>
Wed, 16 Jul 2025 13:54:35 +0000 (09:54 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 16 Jul 2025 13:54:35 +0000 (09:54 -0400)
contrib/pg_plan_advice/pg_plan_advice.c
contrib/pg_plan_advice/pg_plan_advice.h
contrib/pg_plan_advice/pgpa_collector.h
contrib/pg_plan_advice/pgpa_join.c
contrib/pg_plan_advice/pgpa_output.c
contrib/pg_plan_advice/pgpa_scan.c
contrib/pg_plan_advice/pgpa_walker.c
contrib/pg_plan_advice/pgpa_walker.h
src/tools/pgindent/typedefs.list

index 03d8e584c4db8d0b495c90bd1b81a145b6bdbb26..e61c1f4f69c453361c331e2bb98f2e7b30e8fb15 100644 (file)
@@ -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 */
index cb4592a76a1006538a363b547a267503d96f23f4..385d3f30529f3e1226571d61dc2fadcfe372e3c7 100644 (file)
@@ -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 */
index fcbad7423b0439527e8104b3020da9339d720911..6f8efa27f02098ffcdd73ee69d3c1d63b5c85992 100644 (file)
@@ -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);
index 65c13765dc3f4af46314cbd48e11b6c6775b91a7..9bbb5d1932156deaebf5cef1a9bfb640a61fd193 100644 (file)
@@ -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);
index 43b82f028ab715f391582d17f4758109b7a6f308..bec5b043450034b9364308243148235583bd2870 100644 (file)
@@ -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);
index 71e982f7e84b0e86bae4a37cf2893896ec740186..8865773b681771bef7f5d4e8ebdf563a78d0488c 100644 (file)
@@ -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;
 
index 51c1ba74638aaa51b6a8221fbce7066c17778e28..597bb3098c785618c8bbac4b19eb20ce91c0fff7 100644 (file)
@@ -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
-        * 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);
index d052563d2f44f586f89883b62336f7aed2d9eb81..871d31801da82a68dfce2573241219ca39de1f4a 100644 (file)
@@ -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;
index 2e2ee9aa9872bc5ee6384b986450dc76df499d65..9efec94efb039c38c093076a52c2c04233227500 100644 (file)
@@ -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