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 1w2sEq-000giA-1H for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 14:51:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2sEn-00Bhe5-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 14:51:09 +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 1w2sEn-00Bhdw-0n for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 14:51:09 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2sEi-00000000NIM-08Nb for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 14:51:08 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-439b9cf8cb5so7915002f8f.0 for ; Wed, 18 Mar 2026 07:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773845464; x=1774450264; 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=ZwdEFH6idgOdrG5WoHLcJTzX1WByQqcHqIQBHk5rkC4=; b=ASrOEeDXRtZw6rhramg3Eld0h5ThYKQhMo7+o0kT0IqqblKcZqqUhvCU2hYJPYDZbl FFUBfWOHH0vdhdjBnNxj4XukBKi8mugzMpioYYWM7cglBep7rUigQmgh00+SK0JSO7hu 0T0NM5teZtK0cPgESp/s7dSlBOwSB5eUMwOlYiIS5vGge0eVqQfq/UCCnHNX+yke459J YYtDz5t8uUU9lNgI8isT7TyktrTe92SnoDoCz7VrBw+eN0+A7dANuYjH4bir2pTl2WBs uR0KSPTRDeLXxKfufuNvZBhr22gMdQoRYqK8gr7ajUBkZbre6QndRd7bWslhzGylZ5bw MbqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773845464; x=1774450264; 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=ZwdEFH6idgOdrG5WoHLcJTzX1WByQqcHqIQBHk5rkC4=; b=L03iS4cERrZdMTq2iwbcR4yyivL35KyEmudXVnCYjUdRnAmKa0+QEWrvcvgC/pATKU 1sA6Tv0gm1Aoi+HWJ7kwWE8LpQS2Z/i973eTPxiCkBr5HdRfqoSG1yum9xnrCgN70+kN AyFGDCFrHWW0wclPziYSIWAMeP/jN0oaadgZITJqliIXD4OSOxsAKfVQwY9Jnc5EDtc+ ML5QkdFIXNxrxfM90qNpwA0KAwQredCxh44hcLixMOoBTepJv4Htj91dnyBI2G7/Kg4c RumoQiNsf2c1LlAi3eT5ENJZ7aP8YBEiRLaJMRS3faXWIS7IhKa+JRLMJZ5K/UJvr0fy 9kFA== X-Forwarded-Encrypted: i=1; AJvYcCWKnV2ffUAMS7dYzsYNrZzuGKcP4Twc/YnKcIseRK2QS4hZRF19mgpWSd82O73ZrxAhme76Il20iYVNlYjz@lists.postgresql.org X-Gm-Message-State: AOJu0YylgmAcH+x0HMq4wGjrXkxfFcntWEKEty0st4QuFGG9Tz99oTDI ivnZpvrbfIWaZ/sFxbH5HINNFLffGjfte22qAOFpkmLSQZG8mBRZe8JA X-Gm-Gg: ATEYQzzU/L2RcRBqEf2RqdYu3TQZ3KjZM+zFSkCGIYN+M2hmkrJ7rQVNySLb+P7YohT UoEbQxAUFfq020V3URAJeWY/PRy+ANpuNkEU/j9MUdCELzcQ37zb6aIun4Tyq7lWekSFXdH30WL yqY7d6GH0rS8EAJP7kzDoHTYvTTbLGkUAS9kf5wRD/GTm7GuuwmM4JL8kOQRz3jYklvYYPcMDnA MbijVX/0hGBt1J12oJKFlAtpBlIqvnntOAM+9N2JhZOw206BThORCQptJGI/bULol7TUNmPz9N5 7jKXchrgLHpqdopUf4DUVOF0NyhaVNh0ZuoQJpgFm+CiA4ZLbyQaL32xMfa7T+xKxYwJs9ErMdk 8KCIve5BzefGM0xYoCdNLSmCKGW/Lx9JL8BjGn3GdJhbE59BM6IIkyKVbaQS8/+o8nAjgFWaNLv 5g9K0VjEB2yAZ8x0fCQbGBTrLnVosThWFGidqiEk4u4+CouU5N+Pn8w8E2iO90t9MMhYpWNHToi IDfdgMgH8CKaWEtOUSru4gqGJazM10LnVoTMoqt9e86meJ0tqXh0t0DvA== X-Received: by 2002:a05:600c:620c:b0:485:40ed:2d1 with SMTP id 5b1f17b1804b1-486f4475049mr61826255e9.17.1773845463810; Wed, 18 Mar 2026 07:51:03 -0700 (PDT) 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-486f4b83930sm21684075e9.17.2026.03.18.07.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 07:51:03 -0700 (PDT) Date: Wed, 18 Mar 2026 14:51:01 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Andres Freund , Jeff Davis , Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NJ5Y8xm2S5PE3Q71" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --NJ5Y8xm2S5PE3Q71 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Wed, Mar 18, 2026 at 05:15:27PM +0900, Michael Paquier wrote: > On Wed, Mar 18, 2026 at 04:36:04AM +0000, Bertrand Drouvot wrote: > >> So, we're back to what we were discussing before the split. As in v7, 0003 is > >> adding the new GUC. So that we can see what having a new GUC implies in ProcSleep() > >> and we can just get rid of 0003 if we think the GUC is not worth the extra complexity > >> (I don't have a strong opinion on it but tempted to think that the extra GUC is > >> not worth it). > > > > PFA, a rebase due to fd6ecbfa75ff. > > Looking again at this patch, all the fields that you are adding are in > non-critical paths, so it looks fine by me to begin with this data > set. Thanks for looking at it! > We may want to document that for future readers of the code to > not add counter increments in the fast code paths, where performance > could matter. Yeah, added a few words in the callers and on top of the function definitions. > Let's also drop 0003 with the GUC. log_lock_waits is enabled by > default and we are in a wait path which would not be > performance-critical. Yeah, that was also my vote. > Regarding the isolation test, the new permutations add 4 pg_sleep() > calls at 500ms each, making the stats test longer. It also looks like > the outputs are the same for the two alternate expected files? Do you > think that it could be possible to move these tests to a new file, > perhaps cutting a bit the sleeps to make it faster? This is done that way in the attached, so that we don't need the extra output in the _1.out file and the test time is reduced (since the deadlock timeout is set to 10ms in the test, I changed the sleep time to 50ms (I did not want to be very close to 10ms)). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --NJ5Y8xm2S5PE3Q71 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v10-0001-Add-lock-statistics.patch"