Re: Add new option 'all' to pg_stat_reset_shared()

Поиск
Список
Период
Сортировка
От torikoshia
Тема Re: Add new option 'all' to pg_stat_reset_shared()
Дата
Msg-id bef9580768ec5e59cae0bd0dbd6e9452@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: Add new option 'all' to pg_stat_reset_shared()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Add new option 'all' to pg_stat_reset_shared()  (Michael Paquier <michael@paquier.xyz>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Corey Huinker
Дата:
Сообщение: Re: Statistics Import and Export
Следующее
От: Hannu Krosing
Дата:
Сообщение: Allowing TRUNCATE of FK target when session_replication_role=replica