Accumulate Memoize parallel worker stats across rescans

When a Gather or Gather Merge node is rescanned, it starts a new set of
workers, which write their Memoize stats into the same shared memory
slots as the previous worker.  ExecEndMemoize() used memcpy() for this,
so EXPLAIN ANALYZE showed only the stats for the final scan.

Here we adjust ExecEndMemoize() to accumulate the counters so that we
gather up the totals over all rescans.

Author: Tatsuya Kawata <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Discussion: 
https://postgr.es/m/cahza6qea-4vb355co-2yaxdmrtpeney0rg9cd2zmlyscyvv...@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bd811277c90a6a29980d664da02e8bddccbe622a

Modified Files
--------------
src/backend/executor/nodeMemoize.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Reply via email to