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: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: bharath.rupireddyforpostgres@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: Wed, 1 Nov 2023 07:54:46 +0900
Message-ID: <ZUGFttiY_DgwUk2s@paquier.xyz> (raw)
In-Reply-To: <bef9580768ec5e59cae0bd0dbd6e9452@oss.nttdata.com>
References: <4291a55137ddda77cf7cc5f46e846daf@oss.nttdata.com>
	<20231030.171713.274529745163206826.horikyota.ntt@gmail.com>
	<CALj2ACVp4K9HqF0Z+k7=Fwg1N5y=74n89T8J7c2cGXFOCquRUA@mail.gmail.com>
	<20231031.115931.1009045759469844714.horikyota.ntt@gmail.com>
	<bef9580768ec5e59cae0bd0dbd6e9452@oss.nttdata.com>

On Tue, Oct 31, 2023 at 04:26:18PM +0900, torikoshia wrote:
> Yes, calling pg_stat_reset_shared() for all stats types can do what I wanted
> to do.
> But calling it with 6 different parameters seems tiresome and I thought it
> would be convenient to have a parameter to delete all cluster-wide
> statistics at once.
> 
> I may be wrong, but I imagine that it's more common to want to delete all of
> the statistics for an entire cluster rather than just a portion of it.

If more flexibility is wanted in this function, could it be an option
to consider a flavor like pg_stat_reset_shared(text[]), where it is
possible to specify a list of shared stats types to reset?  Perhaps
there are no real use cases for it, just wanted to mention it anyway
regarding the fact that it could have benefits to refactor this code
to use a bitwise operator for its internals with bit flags for each
type.
--
Michael

Attachments:

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

view thread (41+ messages)  latest in thread

Message-ID: <ZUGFttiY_DgwUk2s@paquier.xyz>
Permalink:  ../ZUGFttiY_DgwUk2s@paquier.xyz/
Also on:    postgresql.org/message-id/ZUGFttiY_DgwUk2s@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, horikyota.ntt@gmail.com, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: Add new option 'all' to pg_stat_reset_shared()
  In-Reply-To: <ZUGFttiY_DgwUk2s@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