On Tue, 17 Nov 2026 at 03:17, Tatsuya Kawata
<[email protected]> wrote:
> When a Gather (or Gather Merge) node is rescanned, a new set of workers
> is started, and they write their Agg stats into the same shared memory
> slots as the previous ones.  ExecEndAgg() overwrites the values, so
> EXPLAIN ANALYZE shows the per-worker Batches etc. only for the last
> execution.

This seems to be a duplicate of [1]. The patches seem to take a
different approach to how hash_batches_used is calculated.

You've got:

+        /* Workers restart on rescan; count the initial batch only once. */
+        if (si->hash_batches_used == 0)
+            si->hash_batches_used = node->hash_batches_used;
+        else
+            si->hash_batches_used += node->hash_batches_used - 1;

Whereas the other patch does:

+        si->hash_batches_used = Max(si->hash_batches_used, 1) +
+            node->hash_batches_used - 1;

Can you state the other patches version isn't correct?

David

[1] 
https://postgr.es/m/CAJTYsWW5evhmWDWAgknx=GXNMJG=k4-T+d435pZpg8Lqxc=k...@mail.gmail.com


Reply via email to