|From:||Nathan Bossart <nathandbossart(at)gmail(dot)com>|
|Subject:||Re: Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
On Wed, Feb 22, 2023 at 12:40:07PM +0000, wangw(dot)fnst(at)fujitsu(dot)com wrote:
> On Wed, Feb 22, 2023 at 8:37 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>> So, even with your patch applied, I don't think the formulas are correct.
>> I don't know if it's worth writing out the exact formula, though. It
>> doesn't seem to be kept up-to-date, and I don't know if users would choose
>> different values for max_locks_per_transaction if it _was_ updated.
>> Perhaps max_connections is a good enough approximation of MaxBackends most
>> of the time...
> Thanks very much for your careful review.
> Yes, you are right. I think the formulas in the v1 patch are all approximations.
> I think the exact formula (see function InitializeMaxBackends) is:
> max_locks_per_transaction * (max_connections + autovacuum_max_workers + 1 +
> max_worker_processes + max_wal_senders +
> After some rethinking, I think users can easily get exact value according to
> exact formula, and I think using accurate formula can help users adjust
> max_locks_per_transaction or max_predicate_locks_per_transaction if needed. So,
> I used the exact formulas in the attached v2 patch.
IMHO this is too verbose. 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.
But if others disagree and think the full formula is appropriate, I'm fine
Amazon Web Services: https://aws.amazon.com
|Next Message||Nathan Bossart||2023-02-22 17:08:28||Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy|
|Previous Message||Jonathan S. Katz||2023-02-22 17:04:29||Re: logical decoding and replication of sequences, take 2|