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 1w8iNX-000o5R-04 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 17:32:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8iNV-00D0GB-2n for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 17:32:18 +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 1w8iNV-00D0FZ-1V for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 17:32:17 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8iNT-00000000ODH-0kmf for pgsql-hackers@postgresql.org; Fri, 03 Apr 2026 17:32:17 +0000 Received: from [10.0.2.15] (unknown [130.41.208.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4fnQlD1pShz49Pv1; Fri, 03 Apr 2026 20:32:08 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1775237528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ac6VnSTv0f3vrjAiZQAnVN28K73oP0jqztdJ4xGlWtM=; b=Ookhzj/kygUs+6MqNW8iVmpVdqrJKg/RdlVw9GVk75ZbKV9pjozQc1c6YoSEsCmY2fP11e CE2IborvokRfnOaPCTAMOU3sioEbrWGbPAHfxsrK0OXwt7StbdaE9iVk5VK8O4H8OaEkYG wKD40kopHvNu4kA988E+pfb9uzgM+I5bSfb5pTyHELV2AhJsIp+Uj7HokEi3TOLLSVoiM/ Z/3GBdw3NWyGGE3/5XuuNZiGjuCetypOK3MKspACvY9x0dop/RPCvFBOOJkfBx8pZMJA6q kx+PSwpBZGBsmMN0A4IwQ1A9EPgKEWwDX0nT37ALrPVTtfK5cCINjlzH0gLcug== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1775237528; b=JPFkB7WZc1L+1KhOtCyaQvNr8fUW5AdCPUldwqKb+KwFRuRGQMe/g16xw9HXgmlH0hDrmC U3l8sPC24W1lzC3hT6UMfmyFiwrM6tjVvJ7x9P/f3FwgA+iRdOpntQU320eA3MJ6dyv2zo ke0inBtI7BTi6/GgQvil4OOxLvaP4Zrn5uRxEd5VXmAJ/ri/m9kSmaEia7Mq9jbFtIyoE0 nx+8zxAAtZVRMGYOP2ZC6cAzMKfXrRUTLbUnrnEJrQQa2IyEHJ4+u55lzQDjTbAtD+Pl3F LqWAI+vnpz6M9GVQy1rBDHDqvMrzr6bFnPC+PA3Z13tB4ZcEWdmtpBgz0hnlFQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1775237528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ac6VnSTv0f3vrjAiZQAnVN28K73oP0jqztdJ4xGlWtM=; b=PfLTk1VIyNALHntPwwzHoqpXuPf5lxnB3t+PojTvlSMGbiVnqWDoE1aNMCDpDj/+vZwros /ET5Xwqc/Iyf/D/r3XFpt0z1tK2qgYkXZirPKQbrJMRbmCDnJ4swXboNiD3RgnRctAxgUG IqTgAlbAStfcoY+Rp19N9KifxbeUmWBQoRNUlyAhVAQuqTM1nrAHqcluizKV6fb1ysbLxh Ui4FFXQRsXM+X5Ok131RRUQJ9EEASY5p1D0Ak1zfEADsw+Z/UOSq1y/6waEMUMKXBhhsBU DqPFzV5FjcqiimBEOpuQ5c/7gHqkMoTKlX/NqHxLvAYBrwHXH7DmgfbfEe35zQ== Message-ID: Date: Fri, 3 Apr 2026 20:32:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Shared hash table allocations To: Ashutosh Bapat Cc: Tomas Vondra , "pgsql-hackers@postgresql.org" , Robert Haas , Rahila Syed , Matthias van de Meent References: <01ab1d41-3eda-4705-8bbd-af898f5007f1@iki.fi> <2981bb36-6bbe-4bdc-9a94-29b1114c79bd@vondra.me> <3026ec05-f664-4ebe-8bf6-0a1218b234ec@iki.fi> <19945803-6bcc-40fe-a14a-7dc5c462ed80@iki.fi> <83e37829-0d94-49b2-ad48-5feb7b5d5e44@iki.fi> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03/04/2026 16:03, Ashutosh Bapat wrote: > On Thu, Apr 2, 2026 at 10:15 PM Heikki Linnakangas wrote: >>> I think the release notes should "nudge" all the >>> users who use non-default max_locks_per_transaction to increase it if >>> they see "out of memory" errors. I don't think it should provide a >>> blanket advise to double their locks >> >> How about: >> >> "If you had previously set max_locks_per_transaction, you might need to >> set it to a higher value in v19 to avoid "out of shared memory" errors. >> If you are unsure what to set it to and don't mind the increased memory >> usage, you can double the value to ensure that you can acquire at least >> as many locks as before" > > The wiggle room is 100KB fixed + 10% of other two structures, so value > by which it should be increased is partly fixed and partly a multiple > of current value. "double the value" is simplest advice we can give. > +1. Ok, committed these patches to remove the safety margins, make LOCK and PROCLOCK fixed-size, and change the default to max_locks_per_transaction=128. I will do one final self-review of the remaining earlier patches from this thread next; I believe they're ready to be committed too. Thanks for the review! - Heikki