pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: torikoshia <torikoshia@oss.nttdata.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: boekewurm+postgres@gmail.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@postgresql.org
Cc: bharath.rupireddyforpostgres@gmail.com
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: Wed, 15 Nov 2023 16:25:14 +0900
Message-ID: <ZVRyWjXccMOCcU3q@paquier.xyz> (raw)
In-Reply-To: <350550211cf7d235cd92e5c7969e8f68@oss.nttdata.com>
References: <20231109012952.fft2i356ofljugt6@awork3.anarazel.de>
	<37bce6feca33e0c0441cd33f9eaa51d6@oss.nttdata.com>
	<ZUyKCE2l3mEf3d2Q@paquier.xyz>
	<89C9D2DC-8239-4373-991A-18CC45D6A5FE@anarazel.de>
	<6c01af77007905c73751f42eea03aef5@oss.nttdata.com>
	<ZVCEvjc_uGo6tEA9@paquier.xyz>
	<a15c51516c1bad37ba73c077dce4927a@oss.nttdata.com>
	<e3c25d72e81378e7b64f3c52e0306fc9@oss.nttdata.com>
	<ZVQVBx49A9Phfw9A@paquier.xyz>
	<350550211cf7d235cd92e5c7969e8f68@oss.nttdata.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (41+ messages)  latest in thread

Message-ID: <ZVRyWjXccMOCcU3q@paquier.xyz>
Permalink:  ../ZVRyWjXccMOCcU3q@paquier.xyz/
Also on:    postgresql.org/message-id/ZVRyWjXccMOCcU3q@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, torikoshia@oss.nttdata.com, andres@anarazel.de, horikyota.ntt@gmail.com, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: Add new option 'all' to pg_stat_reset_shared()
  In-Reply-To: <ZVRyWjXccMOCcU3q@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox