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

From Andres Freund
Subject Re: Custom pgstat support performance regression for simple queries
Date
Msg-id wodjqx2sgaqznuq4agyh2v572qxoao2twrn5igq4smfut22i74@zvswmootae4y
Whole thread Raw
In response to Re: Custom pgstat support performance regression for simple queries  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Custom pgstat support performance regression for simple queries
List pgsql-hackers
Hi,

On 2025-07-23 10:23:53 +0000, Bertrand Drouvot wrote:
> On Wed, Jul 23, 2025 at 05:09:54PM +0900, Michael Paquier wrote:
> > so we don’t really need to mix multiple numbers; we could just have a single
> > boolean flag that any fixed-sized stats kinds can set to let the reporting know
> > that some activity has happened.
> 
> That works to say "there are pending stats" but not well to say "there are no
> pending stats".
> 
> Indeed, with a single boolean flag, then how could a stat say that it has nothing
> pending anymore (when flushing) without saying "all the stats have nothing
> pending" (while some may still have pending stats)?

I don't think that's a problem - reset that global flag after checking it at
the start of pgstat_report_stat() and set it to true if partial_flush is true
at the end of pgstat_report_stat().

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: trivial grammar refactor
Next
From: Andres Freund
Date:
Subject: Re: Custom pgstat support performance regression for simple queries