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

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Add new option 'all' to pg_stat_reset_shared()
Дата
Msg-id 20231109012952.fft2i356ofljugt6@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: Add new option 'all' to pg_stat_reset_shared()  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Add new option 'all' to pg_stat_reset_shared()  (torikoshia <torikoshia@oss.nttdata.com>)
Список pgsql-hackers
Hi,

On 2023-11-09 10:25:18 +0900, Michael Paquier wrote:
> On Thu, Nov 09, 2023 at 10:10:39AM +0900, torikoshia wrote:
> > I am a little concerned about that the reset time is not the same and that
> > GetCurrentTimestamp() is called multiple times, but I think it would be
> > acceptable because the function is probably not used that often and the
> > reset time is not atomic in practice.
> 
> Arf, right.  I misremembered that this is just a clock_timestamp() so
> that's not transaction-resilient.  Anyway, my take is that this is not
> a big deal in practice compared to the usability of the wrapper.

It seems inconsequential cost-wise. Resetting stats is way more expensive that
a few timestamp determinations. Correctness wise it actually seems *better* to
record the timestamps more granularly, after all, that moves them closer to
the time the individual kind of stats is reset.

Greetings,

Andres Freund



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

Предыдущее
От: Crisp Lee
Дата:
Сообщение: Re: make pg_ctl more friendly
Следующее
От: Andres Freund
Дата:
Сообщение: Re: make pg_ctl more friendly