pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Add per-backend AIO statistics
Date: Fri, 10 Jul 2026 04:56:09 +0000
Message-ID: <alB7acgJ/WW7B1yC@bdtpg> (raw)
In-Reply-To: <ak8hTtwna+uha7aq@bdtpg>
References: <akzcq9jtWK5C92g1@bdtpg>
	<ak3zpA2HHh5CxQK8@paquier.xyz>
	<et272fdhdx6yphlgzvrgsf7bgwnf3vqciwp4gxqubro42uaflp@ohslaocvwgvi>
	<ak8hTtwna+uha7aq@bdtpg>

Hi,

On Thu, Jul 09, 2026 at 04:19:26AM +0000, Bertrand Drouvot wrote:
> Hi,
> 
> On Wed, Jul 08, 2026 at 02:08:00PM -0400, Andres Freund wrote:
> 
> > Unfortunately I'm pretty doubtful that pgstat_backend.c is the right
> > architectural direction. It'll just end up implementing all kinds of stats,
> > since we'll incrementally want more and more per-backend stats.  I think what
> > we'd want is rather something where for each applicable stats kind we have a
> > shared counter for all exited backends and then per-backend counters for live
> > backends, with helpers to aggregate the exited + live stats to a total.
> 
> That's a very nice proposal that would avoid the double counting. OTOH, that's
> also a major re-design that would benefit all existing per-backend stats kinds.
> 
> I can see 2 options:
> 
> 1/ 
> 
> step 1: Implement per-backend AIO stats (like proposed taking into account your
> remark about useless, derivable fields) + a global view. 
> step 2: work on the re-design
> 
> 2/
> 
> step 1: work on the redesign
> step 2: Add AIO stats based on the re-design
> 
> The pros of 1/ is that step 1 would most probably land in 20, providing more user
> visibility (+ it could be used or improved during the AIO write project). Step 2
> is a much larger project that might not land in 20.
> 
> The cons, would be double counting (as there is no need to try to implement
> something like [1] as we are going to re-design anyway).
> 
> I'll be tempted to vote for 1/ to provide faster added value. What do you (Andres,
> Michael) think?

Actually, there is no rush to merge the per-backend AIO stats (we still have
plenty of time for 20). So let's try option 2 and implement the new design first
and see where it goes. I'll create a dedicated thread once ready.

Regards,

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






view thread (9+ messages)  latest in thread

Message-ID: <alB7acgJ/WW7B1yC@bdtpg>
Permalink:  ../alB7acgJ%2FWW7B1yC@bdtpg/
Also on:    postgresql.org/message-id/alB7acgJ/WW7B1yC@bdtpg

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: pgsql-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com, andres@anarazel.de, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Add per-backend AIO statistics
  In-Reply-To: <alB7acgJ/WW7B1yC@bdtpg>

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

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