diff options
author | Amit Kapila | 2020-07-25 04:50:39 +0000 |
---|---|---|
committer | Amit Kapila | 2020-07-25 04:50:39 +0000 |
commit | 2a2494229a709b880a6db82d8b267017fccf671f (patch) | |
tree | 99c176e92f6eac220183bd58353a1bc5b231a403 /src/backend/executor/execProcnode.c | |
parent | 79d6d1a277ee1cdda90f9a66d7970ac3885822de (diff) |
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 <[email protected]>
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/execProcnode.c')
-rw-r--r-- | src/backend/executor/execProcnode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c index 5662e7d7421..01b7b926bf7 100644 --- a/src/backend/executor/execProcnode.c +++ b/src/backend/executor/execProcnode.c @@ -755,8 +755,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 @@ -770,6 +768,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: |