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 1ulr9M-006S3a-Cg for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Aug 2025 15:42:56 +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 1ulr9K-0080dp-RB for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Aug 2025 15:42:55 +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 1ulr9K-0080dh-DB for pgsql-hackers@lists.postgresql.org; Tue, 12 Aug 2025 15:42:54 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ulr9H-000Dr5-2B for pgsql-hackers@lists.postgresql.org; Tue, 12 Aug 2025 15:42:53 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-74264d1832eso7014600b3a.0 for ; Tue, 12 Aug 2025 08:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1755013369; x=1755618169; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=CCRzHn11CW7ET5MxMYXz4xxWIQNAYLhygI7H3LK2XE0=; b=GwqJDKQO1xw2//Uvg+J+NpNc1EpE8w9FVZ9F9aNlyoYjfVfFgBIiK5EH21ZMoKZQEr u84nvlHobUoHmrSEPEH+q7OLitjPh4C9fzhWzY+V+68xjLMg14KyMtg+YFHNsFCj0Zmk 4Wm2agAaIF1eebpTrQTGDWSseYFoOtuVrRc+ahvzpo5dK53KkPCnUxT6yNLg12p3g8wZ t+M9YcHiTd7sIt9Uz3eufMVeR8YsEvU0A0UERMvvntmV66LIxFlmgExHvk0Blq4aS1Qf bylb0adh5XzsWPHCJDuBgUweaUPNRn/zqOSzxapwZhqbMd8BxzUucG97S2FhDlfbi0y+ 8rKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755013369; x=1755618169; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CCRzHn11CW7ET5MxMYXz4xxWIQNAYLhygI7H3LK2XE0=; b=BuMpEZG8kgwrpCxtxXEDmEBG0By9V2zTpep5s4Y1/BFCdSgzp/IJQ8/QkrI16mvk2X QiEZW74Kia6npcW63BWlQX7SCu+ZglzX2UqLi05QgKeUj3pUidwgnbfj95p9wjbbTS49 z/n0SGb5i+fETsJyC9V4VW+CdykQnLDSvDtWshQULnmcshGKF5aa2d0cvNyhzYcyjadm SbV16x9wgPwJs8tZZQ1L2hen0lIkzf1FoWFyKzdBw/DXdL4MQ9MG8aFXh/ziXwhDdDjF 1yxUKplmYiqMWa0oTnagfLHFncdE0ezt8Xbd3h3i3OgzIPdd9PMcbJgRYbaXq1mH883w wwIQ== X-Forwarded-Encrypted: i=1; AJvYcCUxFGNvwPWawau2fS07r0C6X6PoAajfxzcVmhdX7bTaIXpD3lrWTmRmgzW1vc1+i+NqbU2p9jAoMoglB6Ek@lists.postgresql.org X-Gm-Message-State: AOJu0Yxhacq3LJONAitd1iH0cIcPpxPrcHx9dj5fQ4/T4LiVZRUzfaIo tq7rJu0gdKdnnn25N2amIceVtRH7H0tjUonZuZUzy4YhJu58XAHf0hEogrEwpR0zPA== X-Gm-Gg: ASbGncv5l0686l9CDqeYzuCG29Kb198B7oc/56aXjbTKu4ACBvnryFqD28V8/YeVQlI oKcyBicdHP7Dr3mEScK1zVfiTQ35rPtMRYwMIUoB1Vh8rBtb8u26PaHNEP4jed2RyuqN51OlvVR Fzasqereq3US7VDiPohM2JGUMvKGXxyLu6bNb/et+vT5IpJwpI7sq6l3rfWxxuivn8u/p2vgWbK uu4ZnKc9sagZkRmw6fFVFI7LmafG1wz1igzt1lmVw2yMU1s2obuzbozM8Wz/Sl1IXbw33cQ4Lk2 bcrUD/Mk2Bo3RORMvYfIPAefNUfHWp5CMv/7I5b5bzwzk75WQ9GTplvgyuYlNYrTPq7O8ndmSHo yk2VApIYXhr6ZbjLZ/pr7VrX8WT5M9FpgPq9r6CrNVCJAy8QW8WLS+y+V5dmpFAlf8z7P X-Google-Smtp-Source: AGHT+IHT7pTJ9uY6jHhbskMrpijRBG4YOcRit4HmJP/Z0Lv3UTYuexz+K6WaUZBOriuPt07CdDX2+w== X-Received: by 2002:a05:6a20:729b:b0:23d:54c1:f1c2 with SMTP id adf61e73a8af0-240551a43dbmr25434944637.23.1755013369307; Tue, 12 Aug 2025 08:42:49 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bccfdf9bdsm29731970b3a.111.2025.08.12.08.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 08:42:48 -0700 (PDT) Message-ID: <1a236172c7dda72939e4293657a90536cce7dd16.camel@j-davis.com> Subject: Re: Adding locks statistics From: Jeff Davis To: Bertrand Drouvot , Michael Paquier Cc: Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Date: Tue, 12 Aug 2025 08:42:48 -0700 In-Reply-To: References: <87c3170d0645cec732f0d7b2969c75db1b3c86c6.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-08-12 at 09:37 +0000, Bertrand Drouvot wrote: > It can be used for example for: >=20 > 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. >=20 > 2. lock_timeout and deadlock_timeout tuning (lock_timeout is visible > only in the > logs if log_min_error_statement is set appropriately). >=20 > 3. checking the "requests"/"fastpath" ratio to see if > "max_locks_per_transaction" > needs tuning (see c4d5cb71d2). > " >=20 > Do these seem like useful use cases? Those seem plausibly useful, but I don't recall needing that exact information myself, 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. Regards, Jeff Davis