public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bertrand Drouvot <[email protected]>
To: Kuba Knysiak <[email protected]>
Cc: [email protected]
Subject: Re: Adding per backend commit and rollback counters
Date: Tue, 31 Mar 2026 09:24:35 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>

Hi,

On Mon, Mar 30, 2026 at 08:19:13PM +0000, Kuba Knysiak wrote:
> Hello,
> after reviewing the patch together with MiƂosz, we found the following:

Thanks for the review!

> - In pgstatfuncs.c, we call pgstat_fetch_stat_backend_by_pid(beentry->st_procpid, NULL)
> for each backend row. That path acquires ProcArrayLock via BackendPidGetProc(),
> so this repeats lock acquisition for every row. We could simplify this and avoid
> taking the lock altogether by fetching directly with
> pgstat_fetch_stat_backend(local_beentry->proc_number).

Yeah, I think that's a good point. Done that way in the attached. Also adding a
check on the backend type as it was done in pgstat_fetch_stat_backend_by_pid().

> Also, shouldn't this patch bump catversion? 

Yes and that was mentioned in the 0003 commit message. We usually don't change
it in the patch itself (could easily produce rebase noise) but just put an
XXX in the commit message so that it's not forgoten when pushed.

Regards,

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


view thread (10+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Adding per backend commit and rollback counters
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox