Fix buffer usage stats for nodes above Gather Merge.
authorAmit Kapila <akapila@postgresql.org>
Sat, 25 Jul 2020 04:50:39 +0000 (10:20 +0530)
committerAmit Kapila <akapila@postgresql.org>
Sat, 25 Jul 2020 04:50:39 +0000 (10:20 +0530)
commit2a2494229a709b880a6db82d8b267017fccf671f
tree99c176e92f6eac220183bd58353a1bc5b231a403
parent79d6d1a277ee1cdda90f9a66d7970ac3885822de
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
src/backend/executor/execProcnode.c