aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2020-07-25 10:48:09 +0530
committerAmit Kapila <akapila@postgresql.org>2020-07-25 10:48:09 +0530
commit603c18b7ee2e100f081bb756b54758b38c59f65f (patch)
treedca8346fa9cfe809a228492737e485482f8f506d /src/backend/executor
parent475c69c976620f7653c15b8dae90ba8dccf5345a (diff)
downloadpostgresql-603c18b7ee2e100f081bb756b54758b38c59f65f.tar.gz
postgresql-603c18b7ee2e100f081bb756b54758b38c59f65f.zip
Fix buffer usage stats for nodes above Gather Merge.
Commit 85c9d347 addressed a similar problem for Gather and Gather Merge nodes but forgot to account for nodes above parallel nodes. This still works for nodes above Gather node because we shut down the workers for Gather node as soon as there are no more tuples. We can do a similar thing for Gather Merge as well but it seems better to account for stats during nodes shutdown after completing the execution. Reported-by: Stéphane Lorek, Jehan-Guillaume de Rorthais Author: Jehan-Guillaume de Rorthais <jgdr@dalibo.com> Reviewed-by: Amit Kapila Backpatch-through: 10, where it was introduced Discussion: https://postgr.es/m/20200718160206.584532a2@firost
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execProcnode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index 610cb4b8a9a..6207677fbc9 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -746,8 +746,6 @@ ExecShutdownNode(PlanState *node)
check_stack_depth();
- planstate_tree_walker(node, ExecShutdownNode, NULL);
-
/*
* Treat the node as running while we shut it down, but only if it's run
* at least once already. We don't expect much CPU consumption during
@@ -761,6 +759,8 @@ ExecShutdownNode(PlanState *node)
if (node->instrument && node->instrument->running)
InstrStartNode(node->instrument);
+ planstate_tree_walker(node, ExecShutdownNode, NULL);
+
switch (nodeTag(node))
{
case T_GatherState: