pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove bogus "safety margin" from predicate.c shmem estimates
Date: Fri, 03 Apr 2026 17:32:04 +0000
Message-ID: <E1w8iNH-002maQ-0y@gemulon.postgresql.org> (raw)

Remove bogus "safety margin" from predicate.c shmem estimates

The 10% safety margin was copy-pasted from lock.c when the predicate
locking code was originally added. However, we later (commit
7c797e7194) added the HASH_FIXED_SIZE flag to the hash tables, which
means that they cannot actually use the safety margin that we're
calculating for them.

The extra memory was mainly used by the main lock manager, which is
the only shmem hash table of non-trivial size that does not use the
HASH_FIXED_SIZE flag. If we wanted to have more space for the lock
manager, we should reserve it directly in lock.c. After this commit,
the lock manager will just have less memory available than before.

Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://www.postgresql.org/message-id/e07be2ba-856b-4ff5-8313-8b58b6b4e4d0@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/feb03dfecdc9810619bc94793be3257a487a669f

Modified Files
--------------
src/backend/storage/lmgr/predicate.c | 6 ------
1 file changed, 6 deletions(-)



Message-ID: <E1w8iNH-002maQ-0y@gemulon.postgresql.org>
Permalink:  ../E1w8iNH-002maQ-0y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w8iNH-002maQ-0y@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove bogus "safety margin" from predicate.c shmem estimates
  In-Reply-To: <E1w8iNH-002maQ-0y@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox