Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ? - Mailing list pgsql-admin

From Julien Rouhaud
Subject Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
Date
Msg-id CAOBaU_b3BG2jicgv7Woyo8vT1V3dnw4xPvMR=AuZ6hMWYuPjKQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
List pgsql-admin
On Mon, Jun 1, 2020 at 12:48 PM Achilleas Mantzios
<achill@matrix.gatewaynet.com> wrote:
>
> On 1/6/20 1:36 μ.μ., Julien Rouhaud wrote:
> > On Mon, Jun 1, 2020 at 12:02 PM Achilleas Mantzios
> > <achill@matrix.gatewaynet.com> wrote:
> > Because read only transaction usually don't consume an xid.  So yes
> > pg_stat_database gives a more reasonable approximation of the real
> > number of transactions happening on the server.
> Thank you, so what would be the official way to monitor txid consumption (from a MVCC / Freezing admin POV)?

I'm not sure what you're really looking for.  If it's the txid
consumption rate, you can use txid_current() at regular interval to
compute it (note that this function will consume a txid).  For object
freeeze, you can use age(datfrozenxid) from pg_database, or
age(relfrozenxid) from pg_class.



pgsql-admin by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
Next
From: Achilleas Mantzios
Date:
Subject: Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?