pgsql: Accumulate Memoize parallel worker stats across rescans

Started by David Rowleyabout 2 months ago1 messagescommitters
Jump to latest
#1David Rowley
drowley@postgresql.org

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 <kawatatatsuya0913@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: /messages/by-id/CAHza6qeA-4vB355co-2yAxDMRTpEneY0rg9CD2zMLYscYvv2UA@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_19_STABLE

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

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