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 10% safety margin from lock manager hash table estimates
Date: Fri, 03 Apr 2026 17:32:04 +0000
Message-ID: <E1w8iNH-002maS-15@gemulon.postgresql.org> (raw)

Remove 10% safety margin from lock manager hash table estimates

As the comment says, the hash table sizes are just estimates, but that
doesn't mean we need a "safety margin" here. hash_estimate_size()
estimates the needed size in bytes pretty accurately for the given
number of elements, so if we wanted room for more elements in the
table, we should just use larger max_table_size in the
hash_estimate_size() call.

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/3e854d2ff1a6ee1d9e0e01319ef41eb466f06c23

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



Message-ID: <E1w8iNH-002maS-15@gemulon.postgresql.org>
Permalink:  ../E1w8iNH-002maS-15@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w8iNH-002maS-15@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 10% safety margin from lock manager hash table estimates
  In-Reply-To: <E1w8iNH-002maS-15@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