Re: Add new option 'all' to pg_stat_reset_shared() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add new option 'all' to pg_stat_reset_shared()
Date
Msg-id ZVRyWjXccMOCcU3q@paquier.xyz
Whole thread Raw
In response to Re: Add new option 'all' to pg_stat_reset_shared()  (torikoshia <torikoshia@oss.nttdata.com>)
Responses Re: Add new option 'all' to pg_stat_reset_shared()
List pgsql-hackers
On Wed, Nov 15, 2023 at 11:58:38AM +0900, torikoshia wrote:
> On 2023-11-15 09:47, Michael Paquier wrote:
>> You have forgotten to update the errhint at the end of
>> pg_stat_reset_shared(), where "slru" needs to be listed :)
>
> Oops, attached v2 patch.

+SELECT stats_reset > :'slru_reset_ts'::timestamptz FROM pg_stat_slru;

A problem with these two queries is that they depend on the number of
SLRUs set in the system while only returning a single 't' without the
cache names each tuple is linked to.  To keep things simple, you could
just LIMIT 1 or aggregate through the whole set.

Other than that, it looks OK.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: kuroda.keisuke@nttcom.co.jp
Date:
Subject: Re: Output affected rows in EXPLAIN
Next
From: "Anton A. Melnikov"
Date:
Subject: Re: Some performance degradation in REL_16 vs REL_15