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 1r1Pkj-00B3mo-9x for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Nov 2023 11:32:45 +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 1r1Pkh-003BQO-Gv for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Nov 2023 11:32:43 +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 1r1Pkh-003BO6-79 for pgsql-hackers@lists.postgresql.org; Fri, 10 Nov 2023 11:32:43 +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 1r1Pkd-004tpX-19 for pgsql-hackers@postgresql.org; Fri, 10 Nov 2023 11:32:41 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 331536098E; Fri, 10 Nov 2023 20:32:34 +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=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 10 Nov 2023 20:32:34 +0900 From: torikoshia To: Andres Freund Cc: Michael Paquier , bharath.rupireddyforpostgres@gmail.com, boekewurm+postgres@gmail.com, Kyotaro Horiguchi , pgsql-hackers@postgresql.org Subject: Re: Add new option 'all' to pg_stat_reset_shared() In-Reply-To: <89C9D2DC-8239-4373-991A-18CC45D6A5FE@anarazel.de> References: <20231104014905.oiropxau5can5fdu@awork3.anarazel.de> <20231108041331.mmxtbr3cmufy4f3v@awork3.anarazel.de> <62d8244b05557a91e25914c02607b493@oss.nttdata.com> <20231109012952.fft2i356ofljugt6@awork3.anarazel.de> <37bce6feca33e0c0441cd33f9eaa51d6@oss.nttdata.com> <89C9D2DC-8239-4373-991A-18CC45D6A5FE@anarazel.de> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <6c01af77007905c73751f42eea03aef5@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-10 13:18, Andres Freund wrote: > Hi, > > On November 8, 2023 11:28:08 PM PST, Michael Paquier > wrote: >> 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. >> >>> 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 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"? > > 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? As described above, since SLRUs cannot be reset by pg_stat_reset_shared(), I feel a bit uncomfortable to delete it all together. -- Regards, -- Atsushi Torikoshi NTT DATA Group Corporation