On Mon, Oct 30, 2023 at 5:46 PM Bharath Rupireddy <bharath.rupireddyforpostg...@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 via email to