Re: Adding locks statistics
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Jeff Davis <pgsql@j-davis.com>, Greg Sabino Mullane <htamfids@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-02-20T16:02:49Z
Lists: pgsql-hackers
Hi, On 2026-02-20 06:38:07 +0000, Bertrand Drouvot wrote: > > If the delay is very > > short it's probably also not that interesting to track, but I guess that's > > debatable. > > v6 was introducing timed_waits so that we have: > > waits > timed_waits > wait_time > fastpath_exceeded > > timed_waits and wait_time were incremented together and waits was incremented > unconditionally. I like the idea of being able to track the numbers of waits > whatever the value of log_lock_waits (or the new track_lock_timing) is. Also > one could compare waits vs timed_waits. How could a user benefit from that split? To me this is pointless number gathering that wastes resources and confuses users. Seriously, youre introducing stats left and right, you really need to stop and first carefully think about what those stats could possibly be useful for. Before writing a patch implementing the stats. Greetings, Andres Freund
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix injection point detach timing problem in TAP test for lock stats
- 3284e3f63cf0 19 (unreleased) landed
-
Use single LWLock for lock statistics in pgstats
- 404a17c155ac 19 (unreleased) landed
-
Add tests for lock statistics, take two
- 557a9f1e3e62 19 (unreleased) landed
-
Remove isolation test lock-stats
- 7c64d56fd976 19 (unreleased) landed
-
Avoid including clog.h in proc.h
- f227b7b20c36 19 (unreleased) landed
-
Don't include storage/lock.h in so many headers
- 2102ebb1953f 19 (unreleased) landed
-
Add support for lock statistics in pgstats
- 4019f725f5d4 19 (unreleased) landed
-
Move some code blocks in lock.c and proc.c
- a90d86518243 19 (unreleased) landed
-
Move declarations related to locktags from lock.h to new locktag.h
- 322bab79744d 19 (unreleased) landed