Re: Custom pgstat support performance regression for simple queries - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Custom pgstat support performance regression for simple queries
Date
Msg-id aICQNfYF1ldIf7hp@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Custom pgstat support performance regression for simple queries  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Custom pgstat support performance regression for simple queries
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Conflict detection for update_deleted in logical replication
Next
From: "Joel Jacobson"
Date:
Subject: Re: Interrupts vs signals