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.94.2) (envelope-from ) id 1um2ae-0092Dc-1G for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Aug 2025 03:55:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1um2ac-00Bhhr-H7 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Aug 2025 03:55:50 +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.94.2) (envelope-from ) id 1um2ac-00Bhhj-7i for pgsql-hackers@lists.postgresql.org; Wed, 13 Aug 2025 03:55:50 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1um2aa-000IS8-0L for pgsql-hackers@lists.postgresql.org; Wed, 13 Aug 2025 03:55:49 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3b7961cf660so4928756f8f.1 for ; Tue, 12 Aug 2025 20:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755057344; x=1755662144; 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=4FeHs348S3xcWlww+SchPZb2dd04kMP4kay/aqz274I=; b=RiuWU/5s1wJhPDhmxIxTMgyV1oy9wqkKRkfSVgYOwNs0EBI6uCaj7A3syDDzE5K4v5 YwknZUvMDsV+8R8ikH77rPKhpi1gY634SzsbjHPEutH10XBj1mspJYokz5NrRgNIlU7a xM8e6iSqY87q3bBvbc0MZ7tas07vD2qqqVwrVNFVdmCJfa82HSRofpELvnsEx3Luz75I FdE0+R6e7FHYuKiky9nI6emxcv5NNnt4O4t78lvo1RxWDGEfQZeL3VMBDhP97Zc1MOcE g9zKENbh+8PF6/viUlvOT21cPIsbKTaTeUQxmY3dmY9pBP1VijZarSQX439IYWafwARb Z0qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755057344; x=1755662144; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4FeHs348S3xcWlww+SchPZb2dd04kMP4kay/aqz274I=; b=BttImkm2WPDttiN2iPhK2SJJT36QAvkv6OwyJM+ezWK5avtw/S4XCxLxjVFu68pz8E TwO+j0opSFsnTB15VZC689++xucJJgbjZdrd01ZLZC/rJg/chIsXtRr3wJjP/J28N6ql zX7r2UPDHNkISoKEENFAxGmtq6ll6ap16r/S61vI7mC4HcNykBXE21svMKWVtumCcyQE uUXxG3aQNDoAktZ1nhCWhlULFQBFEGigDiBkdyNyJjtCmlsdtUOVKomxZe5O1Xj+GCH1 oW4Z3O4X++YQz/zmQUwrsuMjJB75Pi3IUPB7CEJoaGPuDX5D+IhJjV17FU7auYePQoB5 KuwQ== X-Forwarded-Encrypted: i=1; AJvYcCVU57CTGnCCCsBotNU4sXrNSnq5JRlQnXXRsv3SrXU8X/IP5BpuHRZnOASiYVXIyMo+ZI9J84T8JqVbyEft@lists.postgresql.org X-Gm-Message-State: AOJu0YycoySVmPpI1L5l/E2hUx6yyi1foP0Ch6uBYCEA1LSMI1ZAnt48 BtvsIdUBOW4vl1s6VQdPwM+mu+jGyxlbG0AjAEbTZxML65oLbDoWbAPK X-Gm-Gg: ASbGncsjL7OAvthzlxmCCJoQi2JVlMFCgl0KxW9ElSzG/Kx6gNvoqjBXBg6N5Ic6jLV KPdMLzB0VDYYtOKMl/SfMccxsoNCC1nV81dDf1854e1jvV9XGEkvwmYa+WkgjsY930ux+7jEhje pGx6YehTEsbpD+bhaW/s4iXwFWklUatMV1QXx1lXMZSlxyHUotUe1tijt2nOdPWxaOdKay5GTAX Z7hp3p/P/p7WhEx6amFtjF2ogkQUj6j5EEPRsOvzHPpq8tfOObGoYxgYGA+EApsa177+y7ZQS4B nij9YjOZ6T/VrNjkUlgORDfg1YpMqE5Ccl10WKQm2jKThVbcVjTomoD728nYmH0JtYP4JqNiBNY FQU4r6GRp47L8slN4tOTP3A7IvfsWENnW25vSzMa7BO17PLCOYSdebpwTUhlDY9qMSsq6vU72Nf SMH5CRO11fj9O0pDnL7dZeI/JB3rhqElLAMqQ9iFj0A6yizD9lwwRR4g== X-Google-Smtp-Source: AGHT+IEmUJR3WHzs+frkfPBpLdKILeXhy3UVY5rY7cvfRtxn4fxeA36SS6eqTUr3XBZiZV9sxE1jzg== X-Received: by 2002:a5d:5d10:0:b0:3b7:9715:75f1 with SMTP id ffacd0b85a97d-3b917e88b76mr772316f8f.36.1755057343629; Tue, 12 Aug 2025 20:55:43 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3abeb2sm46203493f8f.11.2025.08.12.20.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 20:55:43 -0700 (PDT) Date: Wed, 13 Aug 2025 03:55:41 +0000 From: Bertrand Drouvot To: Jeff Davis Cc: Michael Paquier , Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics Message-ID: References: <87c3170d0645cec732f0d7b2969c75db1b3c86c6.camel@j-davis.com> <1a236172c7dda72939e4293657a90536cce7dd16.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a236172c7dda72939e4293657a90536cce7dd16.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Aug 12, 2025 at 08:42:48AM -0700, Jeff Davis wrote: > On Tue, 2025-08-12 at 09:37 +0000, Bertrand Drouvot wrote: > > It can be used for example for: > > > > 1. checking if "waits" is close to "requests". Then it means you > > usually have to > > wait before acquiring the lock, which means you may have a > > concurrency issue. > > > > 2. lock_timeout and deadlock_timeout tuning (lock_timeout is visible > > only in the > > logs if log_min_error_statement is set appropriately). > > > > 3. checking the "requests"/"fastpath" ratio to see if > > "max_locks_per_transaction" > > needs tuning (see c4d5cb71d2). > > " > > > > Do these seem like useful use cases? > > Those seem plausibly useful, Thanks for sharing your thoughts about the use cases above. > and I wanted to hear more from others. > For instance, a view could be helpful to diagnose concurrency issues, > but I think that's worth discussing in more detail to see what kinds of > issues it can help with and how it complements other approaches. I > suspect when we get into the details, different people (or different > situations) would want slightly different information out of that view. Fully agree, getting input from others definitely helps validate the approach and see if the current design needs some changes. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com