Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vtUH6-00Ak3O-0P for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 17:26:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtUH4-008fiR-2t for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 17:26:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vtUH4-008fiG-1x for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 17:26:42 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vtUH1-00000000OXb-1r8y for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 17:26:41 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-483703e4b08so18550245e9.1 for ; Fri, 20 Feb 2026 09:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771608399; x=1772213199; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=12JQV4iZM18WrFnY5+f5P9FeVGRM6eqQ16orV3vByHc=; b=bFHvHnR6dngp2NBMUcd1gvdjCroA16ERlQqYgxG+Tegk1QMzYLvVEa0Sb0jtpKpVcj LY/MT2dkwIaHXe+q9SUJvEkYM+ukx8ddDFnYCTD9mu6mywxz8078WZFQbFTXzttkqef2 Q118vc7Ee1DIMEdk7XPx3GFhifyQfoI3pVYynMV0T+fj9T0VuC+yPmjlAQp0OxMkmFer j9GebqwGhUqc3WGwvd6jvnB4631qZm52k6g8KR8OFGSplnOwdNJpy/qo3i1fqdgbo6hI /CE7R6R6x0HJOTnqUDC0nb65zLtEOAzqEgQfnK72FdvVHKGFG67PRR/zEateUv+kmhuR tCOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771608399; x=1772213199; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=12JQV4iZM18WrFnY5+f5P9FeVGRM6eqQ16orV3vByHc=; b=psf4hu6WtipH5i6553CmdwZN1q4FzLevbJv2ciCzFI2KstrJhUVCJmTClado7NDDmo 8FZ+RZGMGxewgnsw3Lb83FUoO2YK05NlhfE7crrtTJYG+dZRDFnYFwfagIJsVxZNPx3B nSESewYyvGE658nAMYc6oa7/YIxM8m5YkOPc7MZgazoXVAcLBYnOIH+br62lKRNraRdA MS1yOmhoXjTL4Ru6vHF9ZVysA425fq4gpkgBrmaOPZfY9PiSx3GVn6XDLd65/LSQOyGO ag6KKDkx1PpZskXgoKnHIa9WKcBiw9JDT9ckksNSN8mfOF0DFYNOIwq68PuPaQ8g7LZX AY1g== X-Forwarded-Encrypted: i=1; AJvYcCXUafGYC7b4UyZgq+IL1ADVS3/FDYYPSevsYbtsq9XYeC0JZvwuXjcTRN8as9iWohCfP1A0bw4mmEHp+v3h@lists.postgresql.org X-Gm-Message-State: AOJu0YySrdnZyONSoe70NOMuSxfTrViuPRBwGl1OKte/9dnQecQw3f7t O36bUgwVvdrmZvr76X9ujqi0Kl3/QHh2cPddFgGwJcj6y9uqcY+RxDUx X-Gm-Gg: AZuq6aJ5mTeK+QQ0v2VFjcb504N93UD7oVbor9ppZpG10qUdyoHwHXI2yErNJbgbSy6 bQjyHo7iFQppkjDryqvpdbNBmFe/mfiOPTDxVVhOI8e8LgHcZyIc6uoQaK/R4mEuPVy9ZId/oe/ MVTLvbdZ0Gv3h5np6bV2Pdgi6RWnNvLU9uYOrdLqeod0j+Jy4+1/6RTfCgFTcPvnsXNv+kt8Tvx XBkMfFcb6yJsGokBkdLfCg85SbOQWIVTU5zvoTVpaKqH09+TAMZ1miDQCmJqJmPwOss+HNGGenC 3KMj7FAFjFOMU1HZQ/74kwmDFSGUxAJo+Tmx+rIFjwhms92Nz2NY3eqFPVuoqQ1eiM8yonWseXe xVVcJFy0S0N4+Fqo6KYx/YkJ1rqgQENhg+R22hSCTVsaVuYUC9c8Weva9Im8Wt0ImxNAIzdNCFb kRd2TdvEowLVs8u5N+TAdRqLtC55qYHV45UarBFoFIlPjReU90jwPg56+0g/rGZja01z8sottv+ h+Giu8IguNLrgZVJrFrPCeZNYhPP7ITAsxF1tBGloeaU6bNvOs8Emi27mHDVNz8SKv0 X-Received: by 2002:a05:600c:8b5b:b0:483:a352:b4e4 with SMTP id 5b1f17b1804b1-483a949e600mr7961885e9.6.1771608398691; Fri, 20 Feb 2026 09:26:38 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a31c0779sm123618585e9.6.2026.02.20.09.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Feb 2026 09:26:38 -0800 (PST) Date: Fri, 20 Feb 2026 17:26:37 +0000 From: Bertrand Drouvot To: Andres Freund Cc: Michael Paquier , Jeff Davis , Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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