Re: Add new option 'all' to pg_stat_reset_shared()
torikoshia <torikoshia@oss.nttdata.com>
From: torikoshia <torikoshia@oss.nttdata.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
bharath.rupireddyforpostgres@gmail.com
Cc: pgsql-hackers@postgresql.org
Date: 2023-10-31T07:26:18Z
Lists: pgsql-hackers
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
Commits
-
Add target "slru" to pg_stat_reset_shared()
- 2e8a0edc2a33 17.0 landed
-
doc: Improve description of targets for pg_stat_reset_shared()
- 7f6bc3b35678 17.0 landed
-
Add support for pg_stat_reset_slru without argument
- e5cca6288a40 17.0 landed
-
Add ability to reset all shared stats types in pg_stat_reset_shared()
- 23c8c0c8f472 17.0 landed