Re: Get rid of pgstat_count_backend_io_op*() functions - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Get rid of pgstat_count_backend_io_op*() functions
Date
Msg-id aLcMc5FuyfeWVTuJ@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Get rid of pgstat_count_backend_io_op*() functions  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
Hi,

On Tue, Sep 02, 2025 at 07:41:59AM +0000, Bertrand Drouvot wrote:
> On Tue, Sep 02, 2025 at 08:19:22AM +0900, Michael Paquier wrote:
> > Removing both the function calls and the extra counter incrementations
> > means to do the same thing as the WAL stats, where we have one
> > structure in charge of incrementing the counters, then the data diffs
> > are fed when flushing the entries in all the stats kinds.  So this
> > would imply the introduction of an equivalent to WalUsage, but applied
> > to the IO stats, like a IOUsage, or something like that.
> 
> Yeah, that sounds more complicated at first but I think that would solve
> the "ordering" issue mentioned above.

Attached is a draft version that implements an equivalent of WalUsage, that way:

- no ordering concerns anymore
- we can also get rid of PgStat_PendingIO ("replaced" by IOUsage)
- we can also get rid of PgStat_BackendPending (since both IO and WAL stats now
use the WAL's approach)

Regards,

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

Attachment

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: pgsql: oauth: Add unit tests for multiplexer handling
Next
From: Nathan Bossart
Date:
Subject: Re: Improve LWLock tranche name visibility across backends