Re: Add new option 'all' to pg_stat_reset_shared()
torikoshia <torikoshia@oss.nttdata.com>
From: torikoshia <torikoshia@oss.nttdata.com>
To: Andres Freund <andres@anarazel.de>,
bharath.rupireddyforpostgres@gmail.com, michael@paquier.xyz
Cc: boekewurm+postgres@gmail.com, Kyotaro Horiguchi
<horikyota.ntt@gmail.com>, pgsql-hackers@postgresql.org
Date: 2023-11-09T04:50:34Z
Lists: pgsql-hackers
Attachments
- v1-0001-Add-ability-to-reset-all-statistics-to-pg_stat_re.patch (text/x-diff) patch v1-0001
On Thu, Nov 09, 2023 at 10:10:39AM +0900, torikoshia wrote: > I'll attach the patch. Attached. On Mon, Nov 6, 2023 at 5:30 PM Bharath Rupireddy > 3. I think the new reset all stats function must also consider > resetting all SLRU stats, no? > /* stats for fixed-numbered objects */ > PGSTAT_KIND_ARCHIVER, > PGSTAT_KIND_BGWRITER, > PGSTAT_KIND_CHECKPOINTER, > PGSTAT_KIND_IO, > PGSTAT_KIND_SLRU, > PGSTAT_KIND_WAL, PGSTAT_KIND_SLRU cannot be reset by pg_stat_reset_shared(), so I feel uncomfortable to delete it all together. It might be better after pg_stat_reset_shared() has been modified to take 'slru' as an argument, though. On Wed, Nov 8, 2023 at 1:13 PM Andres Freund <andres@anarazel.de> wrote: > It's not like oids are a precious resource. It's a more confusing API > to have > to have to specify a NULL as an argument than not having to do so. If > we > really want to avoid a separate oid, a more sensible path would be to > add a > default argument to pg_stat_reset_slru() (by doing a CREATE OR REPLACE > in > system_functions.sql). Currently proisstrict is true and pg_stat_reset_shared() returns null without doing any work. I thought it would be better to reset statistics even when null is specified so that users are not confused with the behavior of pg_stat_reset_slru(). Attached patch added pg_stat_reset_shared() in system_functions.sql mainly for this reason. -- Regards, -- Atsushi Torikoshi NTT DATA Group Corporation
Commits
-
Add target "slru" to pg_stat_reset_shared()
- 2e8a0edc2a33 17.0 landed
-
doc: Improve description of targets for pg_stat_reset_shared()
- 7f6bc3b35678 17.0 landed
-
Add support for pg_stat_reset_slru without argument
- e5cca6288a40 17.0 landed
-
Add ability to reset all shared stats types in pg_stat_reset_shared()
- 23c8c0c8f472 17.0 landed