Skip to content

Commit f963b5b

Browse files
author
Amit Kapila
committed
Fix buffer usage stats for nodes above Gather Merge.
Commit 85c9d34 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
1 parent d8ec3b1 commit f963b5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/executor/execProcnode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,6 @@ ExecShutdownNode(PlanState *node)
731731

732732
check_stack_depth();
733733

734-
planstate_tree_walker(node, ExecShutdownNode, NULL);
735-
736734
/*
737735
* Treat the node as running while we shut it down, but only if it's run
738736
* at least once already. We don't expect much CPU consumption during
@@ -746,6 +744,8 @@ ExecShutdownNode(PlanState *node)
746744
if (node->instrument && node->instrument->running)
747745
InstrStartNode(node->instrument);
748746

747+
planstate_tree_walker(node, ExecShutdownNode, NULL);
748+
749749
switch (nodeTag(node))
750750
{
751751
case T_GatherState:

0 commit comments

Comments
 (0)