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 1w8oPY-000u2f-1b for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 23:58:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8oPX-00Eafr-14 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 23:58:47 +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.96) (envelope-from ) id 1w8oPW-00Eafb-34 for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 23:58:47 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8oPV-00000000Sk7-0GL3 for pgsql-hackers@postgresql.org; Fri, 03 Apr 2026 23:58:47 +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 4fnbKG6k7fz49Q1q; Sat, 04 Apr 2026 02:58:42 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1775260724; 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=7q1MOde9R7kO79ZSg54ynnf5EFfQSYQWF65+64dq1yo=; b=RYOswkekc/MmCR0oKniXAiIGkGjq9R68ALwpMmZVD33A5acNBdZUJFsaCtPI4B6CKItL/m /1tAosEREZ3Ch3C3KVQLDpwAd7qxC3xscLYuxlsbUoHOweMXq4DHOGjUPWNPNmpw8Rqjbu K2nhK5TuNWdFPxT5hz8+UNAechve9FdVwkO1WGORS63/brYRvVMV5XF9xFLevKjlYgTJEo E0pbTRPqTaKEUCz+qojv9p0YVjFF9Ri+i7kTMq/AmEqYLKtX9npfT2/R2sCjfALZJMbV8X N8g1uP8GuuCMwsjM1eEn5mNP3Nz7V5SMonFH1WMspQLlB8pF5VXwG4ZwzQY3Sw== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1775260724; b=tgjZ6jKt668TgRoMI6HoQgYZ0HQt4i7pdVZABzA/aBw66YATRKxogt7kysQRac1ARpPh3y 3At1bN4ZLgOyOZo0FJceO81SzHLSwKB6+XO2fYHITH8bc5eQhhXqFda7mK1KL/0qMMMrL+ P1Bzn8/SliTpbAuGoDvkBWiKQzOT3MTOMZLGrAhpjvnt9a181uPnAty+3Sk65AGBgxCYUj DCMNzKreWl529/wSvJYCPYAqsViC6cs7kd0RkXL4Tjn/nUPuw6SKHKarbZTcAIXIDeynyC z1Us7CLH2VwHqL04Lo9e7kfPv6a1CtE/MJXEu1lM6Dl2QQSjLWJNT7xmXACJRg== 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=1775260724; 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=7q1MOde9R7kO79ZSg54ynnf5EFfQSYQWF65+64dq1yo=; b=TcZGv9Z/2FdrM42z9VUqiUh9++ZbaAiucpvCl6ss+SxHJ1P0ZO6WLHAcdvupfd36kiAwq4 xduAI8LEM260BxJy7XtDaoEe7MyLGWGtSpuKIhWS0amU8L+B6J+na6ecTICU6tcoRytJl8 7YJcoh9KQNPxholEIaMF8944Zo22jz8QRTJL690iuC7h3zFfFo9n2lf9tkqVyIK8oipbZ8 DKyGXg5itb+OrU+uQ4oTkO7oMzIRpZ5VilSDltjF3ukxmXLAJmY5VZUJnEDe5U9T/xSOjq dLXVGHiwh+Ij1JmnZNfX3V1jgl/MWlZ8SyggCSg2XB+9O7B+E0RGB9TC/23+9g== Message-ID: <0f708be9-c95b-421d-8ee4-a41455bfb64a@iki.fi> Date: Sat, 4 Apr 2026 02:58:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Shared hash table allocations From: Heikki Linnakangas 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 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 20:32, Heikki Linnakangas wrote: > 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! And committed the rest of the patches from this thread now too, after some small fixes and cleanups. Thanks again! - Heikki