pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: torikoshia <torikoshia@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: boekewurm+postgres@gmail.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: Thu, 09 Nov 2023 10:10:39 +0900
Message-ID: <62d8244b05557a91e25914c02607b493@oss.nttdata.com> (raw)
In-Reply-To: <ZUwguPB1rTXBK5CT@paquier.xyz>
References: <CALj2ACVp4K9HqF0Z+k7=Fwg1N5y=74n89T8J7c2cGXFOCquRUA@mail.gmail.com>
	<20231031.115931.1009045759469844714.horikyota.ntt@gmail.com>
	<bef9580768ec5e59cae0bd0dbd6e9452@oss.nttdata.com>
	<ZUGFttiY_DgwUk2s@paquier.xyz>
	<CALj2ACXQTKMYL-aYKM=XObQ27wyD3V2yRGeF1z=jJN7vptgNgg@mail.gmail.com>
	<20231104014905.oiropxau5can5fdu@awork3.anarazel.de>
	<e784c0d54c849e86d69138883d12138f@oss.nttdata.com>
	<CALj2ACVjpHfkCUWSMfpX-oyuqDCenbbduxNfQWPUBXZ0TChMrg@mail.gmail.com>
	<20231108041331.mmxtbr3cmufy4f3v@awork3.anarazel.de>
	<CALj2ACW4Fqc_m+OaavrOMEivZ5aBa24pVKvoXRTmuFECsNBfAg@mail.gmail.com>
	<ZUwguPB1rTXBK5CT@paquier.xyz>

On 2023-11-09 08:58, Michael Paquier wrote:
> On Wed, Nov 08, 2023 at 02:15:24PM +0530, Bharath Rupireddy wrote:
>> On Wed, Nov 8, 2023 at 9:43 AM Andres Freund <andres@anarazel.de> 
>> wrote:
>>> It's not like oids are a precious resource. It's a more confusing API 
>>> to have
>>> to have to specify a NULL as an argument than not having to do so. If 
>>> we
>>> really want to avoid a separate oid, a more sensible path would be to 
>>> add a
>>> default argument to pg_stat_reset_slru() (by doing a CREATE OR 
>>> REPLACE in
>>> system_functions.sql).
>> 
>> +1. Attached the patch.
>> 
>>  -- Test that multiple SLRUs are reset when no specific SLRU provided 
>> to reset function
>> -SELECT pg_stat_reset_slru(NULL);
>> +SELECT pg_stat_reset_slru();
> 
> For the SLRU part, why not.
> 
> Hmm.  What's the final plan for pg_stat_reset_shared(), then?  An
> equivalent that calls a series of pgstat_reset_of_kind()?

Sorry for late reply and thanks for the feedbacks everyone.

As your 1st suggestion, I think "calls a series of 
pgstat_reset_of_kind()" would be enough.

I am a little concerned about that the reset time is not the same and 
that GetCurrentTimestamp() is called multiple times, but I think it 
would be acceptable because the function is probably not used that often 
and the reset time is not atomic in practice.

I'll attach the patch.

-- 
Regards,

--
Atsushi Torikoshi
NTT DATA Group Corporation





view thread (41+ messages)  latest in thread

Message-ID: <62d8244b05557a91e25914c02607b493@oss.nttdata.com>
Permalink:  ../62d8244b05557a91e25914c02607b493@oss.nttdata.com/
Also on:    postgresql.org/message-id/62d8244b05557a91e25914c02607b493@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: torikoshia@oss.nttdata.com, michael@paquier.xyz, bharath.rupireddyforpostgres@gmail.com, andres@anarazel.de, horikyota.ntt@gmail.com
  Subject: Re: Add new option 'all' to pg_stat_reset_shared()
  In-Reply-To: <62d8244b05557a91e25914c02607b493@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox