Re: Adding per backend commit and rollback counters - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Adding per backend commit and rollback counters
Date
Msg-id aLB+zGDBofLDxx9o@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Adding per backend commit and rollback counters  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
Hi,

On Sun, Aug 10, 2025 at 07:47:09AM +0000, Bertrand Drouvot wrote:
> To sum up, v3 contains:
> 
> 0001 -
> Adding per backend commit and rollback counters
> 0002 - 
> Adding XID generation count per backend
> 0003 -
> Adding the pg_stat_backend view

Following recent conversations in [1], those changes have been made in v4
attached:

- avoid tracking the commit and rollback counters twice (for databases and for
backends) but increment the backend stats when the database ones are flushed. Same
idea as [2].

- pg_stat_backend is too generic (see [3]), let's use pg_stat_backend_transaction 
instead. I deliberately did not use pg_stat_backend_xact to not confuse with the
other "*xact*" functions/views where the meaning is not the same. I'm open to
other naming suggestion though.

[1]: https://www.postgresql.org/message-id/flat/aJrxug4LCg4Hm5Mm%40ip-10-97-1-34.eu-west-3.compute.internal
[2]: https://www.postgresql.org/message-id/7fhpds4xqk6bnudzmzkqi33pinsxammpljwde5gfkjdygvejrj%40ojkzfr7dxkmm
[3]: https://www.postgresql.org/message-id/aK8OuVPmmDTc9CFX%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Per backend relation statistics tracking
Next
From: Andres Freund
Date:
Subject: Re: index prefetching