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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
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-12 07:54:38
Message-ID: ZVCEvjc_uGo6tEA9@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 10, 2023 at 08:32:34PM +0900, torikoshia wrote:
> On 2023-11-10 13:18, Andres Freund wrote:
>> I see no reason to not include slrus. We should never have added the
>> ability to reset them individually, particularly not without a use
>> case - I couldn't find one skimming some discussion. And what's the
>> point in not allowing to reset them via pg_stat_reset_shared()?
>
> When including SLRUs, do you think it's better to add 'slrus' argument which
> enables pg_stat_reset_shared() to reset all SLRUs?

I understand that Andres says that he'd be OK with a addition of a
'slru' option in pg_stat_reset_shared(), as well as including SLRUs in
the resets if everything should be wiped.

28cac71bd368 is around since 13~, so changing pg_stat_reset_slru() or
removing it could impact existing applications, so there's little
benefit in changing it at this stage. Let it be itself.

> As described above, since SLRUs cannot be reset by pg_stat_reset_shared(), I
> feel a bit uncomfortable to delete it all together.

That would be only effective if NULL is given to the function to reset
everything, which is OK IMO, because this is a shared stats.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2023-11-12 09:38:52 Re: Parallel CREATE INDEX for BRIN indexes
Previous Message Michael Paquier 2023-11-12 07:46:51 Re: Add new option 'all' to pg_stat_reset_shared()