Re: pg_stat_database view column xact_commit description should be more descriptive? - Mailing list pgsql-docs

From David G. Johnston
Subject Re: pg_stat_database view column xact_commit description should be more descriptive?
Date
Msg-id CAKFQuwZh1a8USr6fHWBXnagXyn1N6EuYXn1t9gtZ1tXgYZkWPw@mail.gmail.com
Whole thread Raw
In response to pg_stat_database view column xact_commit description should be more descriptive?  (jian he <jian.universality@gmail.com>)
Responses Re: pg_stat_database view column xact_commit description should be more descriptive?  (jian he <jian.universality@gmail.com>)
List pgsql-docs


On Thursday, June 2, 2022, jian he <jian.universality@gmail.com> wrote:

xact_commit bigint

Number of transactions in this database that have been committed


BEGIN initiates a transaction block, that is, all statements after a BEGIN command will be executed in a single transaction until an explicit COMMIT or ROLLBACK is given. By default (without BEGIN), PostgreSQL executes transactions in autocommit mode, that is, each statement is executed in its own transaction and a commit is implicitly performed at the end of the statement (if execution was successful, otherwise a rollback is done).

I guess the pg_stat_database view column xact_commit refers to 'non-autocommit' transactions?
If so, should we say something like "Number of  autocommit  transactions...."

My guess is that it doesn’t matter if it’s implicit or explicit and thus the documentation is correct and adequate.  It does seem easy enough to prove one way or the other if you think it might be incorrect and thus to warrant a change to the docs.   If it does vary I’d have reason to suspect that a pure select query would exhibit different behavior than an insert or delete query - i.e., whether a new xid is issued makes a difference.

I may experiment myself when I’m back at a computer but as you are raising the potential issue the research seems like something that should be done to support the suggestion.  It isn’t like this will require source code reading to discern.

David J.

pgsql-docs by date:

Previous
From: jian he
Date:
Subject: pg_stat_database view column xact_commit description should be more descriptive?
Next
From: jian he
Date:
Subject: Re: pg_stat_database view column xact_commit description should be more descriptive?