Hi,
On Wed, Jul 23, 2025 at 09:54:12AM +0900, Michael Paquier wrote:
> Then, about the loop used here, I'd be OK to keep the past shortcuts
> for the builtin fixed-sized stats kinds with the requirement that new
> builtin stats kinds need to hack into pgstat_report_stat() themselves
> on efficiency grounds
Maybe we could use a flag, say:
#define PGSTAT_PENDING_IO (1 << 0)
#define PGSTAT_PENDING_WAL (1 << 1)
#define PGSTAT_PENDING_SLRU (1 << 2)
and check for a pgstat_pending_mask in pgstat_report_stat() instead?
They would need to set pgstat_pending_mask accordingly when they flush, have
pending stats though.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com