From: torikoshia <torikoshia@oss.nttdata.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: bharath.rupireddyforpostgres@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: Tue, 31 Oct 2023 16:26:18 +0900
Message-ID: <bef9580768ec5e59cae0bd0dbd6e9452@oss.nttdata.com> (raw)
In-Reply-To: <20231031.115931.1009045759469844714.horikyota.ntt@gmail.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>
On Mon, Oct 30, 2023 at 5:46 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
Thanks for the comments!
> Isn't calling pg_stat_reset_shared() for all stats types helping you
> out? Is there any problem with it? Can you be more specific about the
> use-case?
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.
> IMV, I don't see any point for adding another pseudo (rather
> non-existent) shared stats target which might confuse users - it's
> easy to specify pg_stat_reset_shared('all'); to clear things out when
> someone actually doesn't want to reset all - an accidental usage of
> the 'all' option will reset all shared memory stats.
I once considered changing the pg_stat_reset_shared() to delete all
stats when called without parameters like pg_stat_statements_reset(),
but gave it up since it can confuse users as you described.
I was hoping that the need to specify 'all' would remind users that the
target can be specified individually.
--
Regards,
--
Atsushi Torikoshi
NTT DATA Group Corporation
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, horikyota.ntt@gmail.com, bharath.rupireddyforpostgres@gmail.com
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
In-Reply-To: <bef9580768ec5e59cae0bd0dbd6e9452@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