aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execAmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execAmi.c')
-rw-r--r--src/backend/executor/execAmi.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 187f892421f..1f18e5d3a2f 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -447,6 +447,36 @@ ExecSupportsMarkRestore(Path *pathnode)
return false; /* childless Result */
}
+ case T_Append:
+ {
+ AppendPath *appendPath = castNode(AppendPath, pathnode);
+
+ /*
+ * If there's exactly one child, then there will be no Append
+ * in the final plan, so we can handle mark/restore if the
+ * child plan node can.
+ */
+ if (list_length(appendPath->subpaths) == 1)
+ return ExecSupportsMarkRestore((Path *) linitial(appendPath->subpaths));
+ /* Otherwise, Append can't handle it */
+ return false;
+ }
+
+ case T_MergeAppend:
+ {
+ MergeAppendPath *mapath = castNode(MergeAppendPath, pathnode);
+
+ /*
+ * Like the Append case above, single-subpath MergeAppends
+ * won't be in the final plan, so just return the child's
+ * mark/restore ability.
+ */
+ if (list_length(mapath->subpaths) == 1)
+ return ExecSupportsMarkRestore((Path *) linitial(mapath->subpaths));
+ /* Otherwise, MergeAppend can't handle it */
+ return false;
+ }
+
default:
break;
}