pgsql: Avoid counting transaction stats for parallel worker cooperating

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid counting transaction stats for parallel worker cooperating
Date: 2019-04-10 03:32:25
Message-ID: E1hE3yL-0005Gy-Kl@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid counting transaction stats for parallel worker cooperating
transaction.

The transaction that is initiated by the parallel worker to cooperate
with the actual transaction started by the main backend to complete the
query execution should not be counted as a separate transaction. The
other internal transactions started and committed by the parallel worker
are still counted as separate transactions as we that is what we do in
other places like autovacuum.

This will partially fix the bloat in transaction stats due to additional
transactions performed by parallel workers. For a complete fix, we need to
decide how we want to show all the transactions that are started internally
for various operations and that is a matter of separate patch.

Reported-by: Haribabu Kommi
Author: Haribabu Kommi
Reviewed-by: Amit Kapila, Jamison Kirk and Rahila Syed
Backpatch-through: 9.6
Discussion: https://postgr.es/m/CAJrrPGc9=jKXuScvNyQ+VNhO0FZk7LLAShAJRyZjnedd2D61EQ@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/09630a1e964d142c1dc291a4d87354621469bf5e

Modified Files
--------------
src/backend/access/transam/twophase.c | 2 +-
src/backend/access/transam/xact.c | 4 ++--
src/backend/postmaster/pgstat.c | 22 +++++++++++++---------
src/include/pgstat.h | 2 +-
4 files changed, 17 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2019-04-10 04:19:11 Re: pgsql: Fix memory leak in pgbench
Previous Message Haribabu Kommi 2019-04-10 03:19:04 Re: pgsql: tableam: basic documentation.