/*
* 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)
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
/*
* 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);
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))
{
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.