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 1ulcHz-003I06-CL for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Aug 2025 23:50:51 +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 1ulcGz-004VN4-QK for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Aug 2025 23:49:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ulcGz-004VMu-Gm for pgsql-hackers@lists.postgresql.org; Mon, 11 Aug 2025 23:49:49 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ulcGx-0006fH-1X for pgsql-hackers@lists.postgresql.org; Mon, 11 Aug 2025 23:49:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 57BNnj8F3282673; Mon, 11 Aug 2025 19:49:45 -0400 From: Tom Lane To: Michael Paquier cc: Jeff Davis , Greg Sabino Mullane , Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics In-reply-to: References: <87c3170d0645cec732f0d7b2969c75db1b3c86c6.camel@j-davis.com> Comments: In-reply-to Michael Paquier message dated "Tue, 12 Aug 2025 08:44:58 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3282671.1754956185.1@sss.pgh.pa.us> Date: Mon, 11 Aug 2025 19:49:45 -0400 Message-ID: <3282672.1754956185@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Mon, Aug 11, 2025 at 02:53:58PM -0700, Jeff Davis wrote: >> Can you describe your use case? I'd like to understand whether this is >> useful for users, hackers, or both. > This is a DBA feature, so the questions I'd ask myself are basically: > - Is there any decision-making where these numbers would help? These > decisions would shape in tweaking the configuration of the server or > the application to as we move from a "bad" number trend to a "good" > number trend. > - What would be good numbers? In this case, most likely a threshold > reached over a certain period of time. > - Would these new stats overlap with similar statistics gathered in > the system, creating duplication and bloat in the pgstats for no real > gain? I'm also wondering why slicing the numbers in this particular way (i.e., aggregating by locktype) is a helpful way to look at the data. Maybe it's just what you want, but that's not obvious to me. regards, tom lane