Re: Add new option 'all' to pg_stat_reset_shared()

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andres Freund <andres(at)anarazel(dot)de>, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, boekewurm+postgres(at)gmail(dot)com, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: 2023-11-10 03:33:50
Message-ID: 31053c5b2110a5fb1871b3068444d1a0@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-11-09 16:28, Michael Paquier wrote:
Thanks for your review.
Attached v2 patch.

> On Thu, Nov 09, 2023 at 01:50:34PM +0900, torikoshia wrote:
>> PGSTAT_KIND_SLRU cannot be reset by pg_stat_reset_shared(), so I feel
>> uncomfortable to delete it all together.
>> It might be better after pg_stat_reset_shared() has been modified to
>> take
>> 'slru' as an argument, though.
>
> Not sure how to feel about that, TBH, but I would not include SLRUs
> here if we have already a separate function.

IMHO I agree with you.

>> I thought it would be better to reset statistics even when null is
>> specified
>> so that users are not confused with the behavior of
>> pg_stat_reset_slru().
>> Attached patch added pg_stat_reset_shared() in system_functions.sql
>> mainly
>> for this reason.
>
> I'm OK with doing what your patch does, aka do the work if the value
> is NULL or if there's no argument given.
>
> - Resets some cluster-wide statistics counters to zero,
> depending on the
> + Resets cluster-wide statistics counters to zero, depending on
> the
>
> This does not need to change, aka SLRUs are for example still global
> and not included here.
>
> + If the argument is NULL or not specified, all counters shown
> in all
> + of these views are reset.
>
> Missing a <literal> markup around NULL. I know, we're not consistent
> about that, either, but if we are tweaking the area let's be right at
> least. Perhaps "all the counters from the views listed above are
> reset"?
> --
> Michael

--
Regards,

--
Atsushi Torikoshi
NTT DATA Group Corporation

Attachment Content-Type Size
v2-0001-Add-ability-to-reset-all-statistics-to-pg_stat_re.patch text/x-diff 7.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2023-11-10 03:47:30 RE: Is this a problem in GenericXLogFinish()?
Previous Message Thomas Munro 2023-11-10 03:31:27 Re: Why is src/test/modules/committs/t/002_standby.pl flaky?