aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeSort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeSort.c')
-rw-r--r--src/backend/executor/nodeSort.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index 66ef109c122..98bcaeb66f5 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -397,6 +397,23 @@ ExecSortInitializeDSM(SortState *node, ParallelContext *pcxt)
}
/* ----------------------------------------------------------------
+ * ExecSortReInitializeDSM
+ *
+ * Reset shared state before beginning a fresh scan.
+ * ----------------------------------------------------------------
+ */
+void
+ExecSortReInitializeDSM(SortState *node, ParallelContext *pcxt)
+{
+ /* If there's any instrumentation space, clear it for next time */
+ if (node->shared_info != NULL)
+ {
+ memset(node->shared_info->sinstrument, 0,
+ node->shared_info->num_workers * sizeof(TuplesortInstrumentation));
+ }
+}
+
+/* ----------------------------------------------------------------
* ExecSortInitializeWorker
*
* Attach worker to DSM space for sort statistics.