pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: torikoshia <torikoshia@oss.nttdata.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: bharath.rupireddyforpostgres@gmail.com, 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, 9 Nov 2023 16:28:08 +0900
Message-ID: <ZUyKCE2l3mEf3d2Q@paquier.xyz> (raw)
In-Reply-To: <37bce6feca33e0c0441cd33f9eaa51d6@oss.nttdata.com>
References: <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>
	<62d8244b05557a91e25914c02607b493@oss.nttdata.com>
	<ZUw0_tA7g0dkTow8@paquier.xyz>
	<20231109012952.fft2i356ofljugt6@awork3.anarazel.de>
	<37bce6feca33e0c0441cd33f9eaa51d6@oss.nttdata.com>

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 <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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (41+ messages)  latest in thread

Message-ID: <ZUyKCE2l3mEf3d2Q@paquier.xyz>
Permalink:  ../ZUyKCE2l3mEf3d2Q@paquier.xyz/
Also on:    postgresql.org/message-id/ZUyKCE2l3mEf3d2Q@paquier.xyz

 · 

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: michael@paquier.xyz, torikoshia@oss.nttdata.com, andres@anarazel.de, horikyota.ntt@gmail.com
  Subject: Re: Add new option 'all' to pg_stat_reset_shared()
  In-Reply-To: <ZUyKCE2l3mEf3d2Q@paquier.xyz>

* 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