Re: Add new option 'all' to pg_stat_reset_shared()
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: bharath.rupireddyforpostgres@gmail.com, torikoshia@oss.nttdata.com, boekewurm+postgres@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org
Date: 2023-11-08T04:18:30Z
Lists: pgsql-hackers
Hi, On 2023-11-08 10:08:42 +0900, Kyotaro Horiguchi wrote: > At Mon, 6 Nov 2023 14:00:13 +0530, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote in > > On Mon, Nov 6, 2023 at 11:39 AM torikoshia <torikoshia@oss.nttdata.com> wrote: > > > Since each stats, except wal_prefetch was reset acquiring LWLock, > > > attached PoC patch makes the call atomic by using these LWlocks. > > > > > > If this is the right direction, I'll try to make wal_prefetch also take > > > LWLock. > > I must say, I have reservations about this approach. The main concern > is the duplication of reset code, which has been efficiently > encapsulated for individual targets, into this location. This practice > degrades the maintainability and clarity of the code. Yes, as-is this seems to evolve the code in precisely the wrong direction. We want less central awareness of different types of stats, not more. The proposed new code is far longer than the current pg_stat_reset(), despite doing something conceptually simpler. Greetings, Andres Freund
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