Re: Custom pgstat support performance regression for simple queries

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)postgresql(dot)org, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: Custom pgstat support performance regression for simple queries
Date: 2025-07-23 15:59:11
Message-ID: wodjqx2sgaqznuq4agyh2v572qxoao2twrn5igq4smfut22i74@zvswmootae4y
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-07-23 16:00:55 Re: Custom pgstat support performance regression for simple queries
Previous Message Nathan Bossart 2025-07-23 15:43:57 Re: trivial grammar refactor