pgindent
authorRobert Haas <rhaas@postgresql.org>
Tue, 24 Jun 2025 16:08:47 +0000 (12:08 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 24 Jun 2025 16:08:47 +0000 (12:08 -0400)
contrib/pg_plan_advice/pgpa_join.c

index 6b2578edf6df0be90a2f33a54d1b6309d1b79c26..1bb8e2c91bcd86f18eb6427ff6fa0ac828bae9de 100644 (file)
@@ -174,26 +174,26 @@ pgpa_unroll_join(PlannedStmt *pstmt, Plan *plan,
 
        /*
         * We need to pass the join_unroller object down through certain types of
-        * plan nodes -- anything that's considered part of the join strategy,
-        * and any other nodes that can occur in a join tree despite not being
-        * scans or joins.
+        * plan nodes -- anything that's considered part of the join strategy, and
+        * any other nodes that can occur in a join tree despite not being scans
+        * or joins.
         *
         * This includes:
         *
         * (1) Materialize, Memoize, and Hash nodes, which are part of the join
         * strategy,
         *
-        * (2) Gather and Gather Merge nodes, which can occur at any point in
-        * the join tree where the planner decided to initiate parallelism,
+        * (2) Gather and Gather Merge nodes, which can occur at any point in the
+        * join tree where the planner decided to initiate parallelism,
         *
         * (3) Sort and IncrementalSort nodes, which can occur beneath MergeJoin
         * or GatherMerge,
         *
-        * (4) Agg and Unique nodes, which can occur when we decide to make
-        * the nullable side of a semijoin unique and then join the result, and
+        * (4) Agg and Unique nodes, which can occur when we decide to make the
+        * nullable side of a semijoin unique and then join the result, and
         *
-        * (5) Result nodes with children, which can be added either to project
-        * to enforce a one-time filter (but Result nodes without children are
+        * (5) Result nodes with children, which can be added either to project to
+        * enforce a one-time filter (but Result nodes without children are
         * degenerate scans or joins).
         */
        if (IsA(plan, Material) || IsA(plan, Memoize) || IsA(plan, Hash)
@@ -381,6 +381,7 @@ pgpa_decompose_join(PlannedStmt *pstmt, Plan *plan,
        switch (nodeTag(plan))
        {
                case T_MergeJoin:
+
                        /*
                         * The planner may have chosen to place a Material node on the
                         * inner side of the MergeJoin; if this is present, we record it
@@ -397,7 +398,8 @@ pgpa_decompose_join(PlannedStmt *pstmt, Plan *plan,
                        /*
                         * For a MergeJoin, either the outer or the inner subplan, or
                         * both, may have needed to be sorted; we must disregard any Sort
-                        * or IncrementalSort node to find the real inner or outer subplan.
+                        * or IncrementalSort node to find the real inner or outer
+                        * subplan.
                         */
                        if (elidedouter == NULL && is_sorting_plan(outerplan))
                                elidedouter = pgpa_descend_node(pstmt, &outerplan);
@@ -406,10 +408,11 @@ pgpa_decompose_join(PlannedStmt *pstmt, Plan *plan,
                        break;
 
                case T_NestLoop:
+
                        /*
-                        * The planner may have chosen to place a Material or Memoize
-                        * node on the inner side of the NestLoop; if this is present,
-                        * we record it as part of the join strategy.
+                        * The planner may have chosen to place a Material or Memoize node
+                        * on the inner side of the NestLoop; if this is present, we
+                        * record it as part of the join strategy.
                         */
                        if (elidedinner == NULL && IsA(innerplan, Material))
                        {
@@ -426,6 +429,7 @@ pgpa_decompose_join(PlannedStmt *pstmt, Plan *plan,
                        break;
 
                case T_HashJoin:
+
                        /*
                         * The inner subplan of a HashJoin is always a Hash node; the real
                         * inner subplan is the Hash node's child.