Make FP_LOCK_SLOTS_PER_BACKEND look like a function
Tomas Vondra <tomas.vondra@postgresql.org>
Make FP_LOCK_SLOTS_PER_BACKEND look like a function The FP_LOCK_SLOTS_PER_BACKEND macro looks like a constant, but it depends on the max_locks_per_transaction GUC, and thus can change. This is non-obvious and confusing, so make it look more like a function by renaming it to FastPathLockSlotsPerBackend(). While at it, use the macro when initializing fast-path shared memory, instead of using the formula. Reported-by: Andres Freund Discussion: https://postgr.es/m/ffiwtzc6vedo6wb4gbwelon5nefqg675t5c7an2ta7pcz646cg%40qwmkdb3l4ett
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/lmgr/lock.c | modified | +5 −5 |
| src/backend/storage/lmgr/proc.c | modified | +2 −2 |
| src/backend/utils/init/postinit.c | modified | +1 −1 |
| src/include/storage/proc.h | modified | +2 −1 |
Discussion
- scalability bottlenecks with (many) partitions (and more) 61 messages · 2024-01-28 → 2025-03-05