pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Accumulate Memoize parallel worker stats across rescans
Date: Wed, 14 Oct 2026 09:08:40 +0000
Message-ID: <E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org> (raw)

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: https://postgr.es/m/CAHza6qeA-4vB355co-2yAxDMRTpEneY0rg9CD2zMLYscYvv2UA@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/04609efb38411ec83c7293528e6ea251e89cb231

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



view thread (7+ messages)  latest in thread

Message-ID: <E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org>
Permalink:  ../E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org
  Subject: Re: pgsql: Accumulate Memoize parallel worker stats across rescans
  In-Reply-To: <E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org>
  References: <E1xGuyW-00000001ZVy-2cPU@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox