Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0tZO-008Lzu-H2 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2023 01:10:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r0tZI-009Elf-HA for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2023 01:10:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0tZI-009ElR-7f for pgsql-hackers@lists.postgresql.org; Thu, 09 Nov 2023 01:10:48 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0tZE-004ext-8V for pgsql-hackers@postgresql.org; Thu, 09 Nov 2023 01:10:46 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id E154760FA0; Thu, 9 Nov 2023 10:10:39 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 09 Nov 2023 10:10:39 +0900 From: torikoshia To: Michael Paquier Cc: Bharath Rupireddy , Andres Freund , boekewurm+postgres@gmail.com, Kyotaro Horiguchi , pgsql-hackers@postgresql.org Subject: Re: Add new option 'all' to pg_stat_reset_shared() In-Reply-To: References: <20231031.115931.1009045759469844714.horikyota.ntt@gmail.com> <20231104014905.oiropxau5can5fdu@awork3.anarazel.de> <20231108041331.mmxtbr3cmufy4f3v@awork3.anarazel.de> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <62d8244b05557a91e25914c02607b493@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 >> 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