[PATCH] Implement dynamic predicate lock ratio limits

From: Arkady Skvorcov <arkashaskv(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Implement dynamic predicate lock ratio limits
Date: 2025-10-29 16:25:00
Message-ID: CAChax7z=RyVL=4RCHX3OnHF9n++fRk-2gQPOdebk2W7iPpZTEQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

This patch series implements the TODO in predicate.c that suggests adding
ratio-based predicate lock limits.
(Resending with patch attachment, cause previous send was missing the
patch file)

The series is split into two logical commits:

1. Core implementation of the GUC variables and predicate lock logic
2. Comprehensive regression tests

Patch overview:
- Adds max_predicate_locks_per_relation_ratio and
max_predicate_locks_per_page_ratio GUCs
- When ratios are > 0, calculates lock limits based on relation size estimates
- Maintains full backward compatibility (default 0.0 = use existing
fixed limits)
- Includes complete regression test coverage

This addresses the TODO comment in MaxPredicateChildLocks() for more
intelligent lock allocation in mixed workloads.

Looking forward to your review!

ArkadySkv

Attachment Content-Type Size
predicate_lock_ratios_series.patch text/x-patch 11.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-10-29 16:47:23 Re: apply_scanjoin_target_to_paths and partitionwise join
Previous Message vignesh C 2025-10-29 16:13:18 Re: Logical Replication of sequences