Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjisn-0000XO-6Q for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Apr 2023 15:47:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjism-0005A6-29 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Apr 2023 15:47:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjisl-00059x-PH for pgsql-hackers@lists.postgresql.org; Tue, 04 Apr 2023 15:47:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pjisi-000rAx-Uv for pgsql-hackers@lists.postgresql.org; Tue, 04 Apr 2023 15:47:39 +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 334FlVsq1515918; Tue, 4 Apr 2023 11:47:31 -0400 From: Tom Lane To: Nathan Bossart cc: "wangw.fnst@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" Subject: Re: Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c In-reply-to: <20230222170737.GA10734@nathanxps13> References: <20230222003716.GA8100@nathanxps13> <20230222170737.GA10734@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Wed, 22 Feb 2023 09:07:37 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1515916.1680623251.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 04 Apr 2023 11:47:31 -0400 Message-ID: <1515917.1680623251@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Wed, Feb 22, 2023 at 12:40:07PM +0000, wangw.fnst@fujitsu.com wrote: >> After some rethinking, I think users can easily get exact value accordi= ng to >> exact formula, and I think using accurate formula can help users adjust >> max_locks_per_transaction or max_predicate_locks_per_transaction if nee= ded. So, >> I used the exact formulas in the attached v2 patch. > IMHO this is too verbose. Yeah, it's impossibly verbose. Even the current wording does not fit nicely in pg_settings output. > Perhaps it could be simplified to something like > The shared lock table is sized on the assumption that at most > max_locks_per_transaction objects per eligible process or prepared > transaction will need to be locked at any one time. I like the "per eligible process" wording, at least for guc_tables.c; or maybe it could be "per server process"? That would be more accurate and not much longer than what we have now. I've got mixed emotions about trying to put the exact formulas into the SGML docs either. Space isn't such a constraint there, but I think the info would soon go out of date (indeed, I think the existing wording was once exactly accurate), and I'm not sure it's worth trying to maintain it precisely. One reason that I'm not very excited about this is that in fact the formula seen in the source code is not exact either; it's a lower bound for how much space will be available. That's because we throw in 100K slop at the bottom of the shmem sizing calculation, and a large chunk of that remains available to be eaten by the lock table if necessary. regards, tom lane