PostgreSQL

Slow path locking requires LWLock acquisition on partition lock hash table

info
performanceUpdated Jul 30, 2025
Technologies:
How to detect:

When fast path limit is exceeded, the lock tag (including relation OID and lock mode) is hashed to one of 16 lock partitions of the shared memory lock hash table. PostgreSQL must acquire the partition LWLock in exclusive mode, update the shared hash table, and release the LWLock for each lock operation.

Recommended action:

This is internal PostgreSQL behavior - mitigation focuses on avoiding slow path by staying within 16 fast path slots. Monitor pg_locks for fastpath='f' indicators. Design queries and schema to minimize locks per transaction through partition pruning, index reduction, and simplified joins.