diff options
| author | Amit Kapila | 2019-04-10 02:54:15 +0000 |
|---|---|---|
| committer | Amit Kapila | 2019-04-10 02:54:15 +0000 |
| commit | bdf35744bdf70208fc4d0f4b76f7d4bce3cf326b (patch) | |
| tree | 9cb868bd578a702726939c010a34fad4188eb0b9 /src/include/pgstat.h | |
| parent | d614aae02e8f878438716b7fd2642b8240b3f2b3 (diff) | |
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
Diffstat (limited to 'src/include/pgstat.h')
| -rw-r--r-- | src/include/pgstat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 5888242f757..a68927b57a2 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -1378,7 +1378,7 @@ extern void pgstat_init_function_usage(FunctionCallInfo fcinfo, extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize); -extern void AtEOXact_PgStat(bool isCommit); +extern void AtEOXact_PgStat(bool isCommit, bool parallel); extern void AtEOSubXact_PgStat(bool isCommit, int nestDepth); extern void AtPrepare_PgStat(void); |
