Remove 10% safety margin from lock manager hash table estimates
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Author:
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2026-04-03T17:26:18Z
Releases:
19 (unreleased)
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/lmgr/lock.c | modified | +0 −5 |
Discussion
- Shared hash table allocations 16 messages · 2026-03-27 → 2026-04-03