Re: pg_stat_get_backend_subxact() and backend IDs?

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: "Imseih (AWS), Sami" <simseih@amazon.com>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, "robertmhaas@gmail.com" <robertmhaas@gmail.com>
Date: 2023-08-25T15:36:21Z
Lists: pgsql-hackers
On Fri, Aug 25, 2023 at 03:01:40PM +0000, Imseih (AWS), Sami wrote:
> 1/ cast the return of bsearch. This was done previously and is the common
> convention in the code.

Will do.

> 2/ This will probably be a good time to update the docs for pg_stat_get_backend_subxact [1]
> to call out that "subxact_count" will "only increase if a transaction is performing writes". Also to link
> the reader to the subtransactions doc [2].

I'd rather keep this patch focused on fixing the bug, given we are so close
to the v16 release.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



Commits

  1. Use actual backend IDs in pg_stat_get_backend_subxact().

  2. Rename some support functions for pgstat* views.

  3. Expose some information about backend subxact status.