public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bertrand Drouvot <[email protected]>
To: Andres Freund <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Jeff Davis <[email protected]>
Cc: Greg Sabino Mullane <[email protected]>
Cc: [email protected]
Subject: Re: Adding locks statistics
Date: Fri, 20 Feb 2026 17:26:37 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <isi5wszczhusgjetxwe6khxa5mbm5jms3msmbhwl73jktxw7ic@3mympoumua76>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<otjn7ykaezlueayyp7fppggkldw23ykh3i6ite2rqq4xh7dwvl@w5dvqqgvqf25>
	<[email protected]>
	<[email protected]>
	<v76tz252usppu2turrn6wxiyyxmybzxhqck5b3amtsbzrc6yto@n26qnwvpkxqw>
	<[email protected]>
	<isi5wszczhusgjetxwe6khxa5mbm5jms3msmbhwl73jktxw7ic@3mympoumua76>

Hi,

On Fri, Feb 20, 2026 at 11:02:49AM -0500, Andres Freund wrote:
> 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.

I was thinking that could be useful to know the distribution between "long" waits
(greater than the deadlock timeout) among all the waits.

If the vast majority are long waits that may indicate that the application is
misbehaving (as opposed to a tiny percentage of long waits).

I was also thinking to bring those stats per-backend (as a next step) and that
could also probably be more useful (distribution per host for example, thanks to
joining with pg_stat_activity).

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






view thread (26+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Adding locks statistics
  In-Reply-To: <[email protected]>

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

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