Excessive exclusive locks indicate lock contention blocking queries
warningperformanceUpdated Jan 21, 2026
Technologies:
How to detect:
More than 10 ExclusiveLock mode locks held for 5+ minutes indicates lock contention that is blocking query execution
Recommended action:
Query pg_locks joined with pg_stat_activity to identify blocking queries and their PIDs. Use pg_terminate_backend(blocking_pid) to kill the blocking session or pg_cancel_backend(blocking_pid) for gentler cancellation. Review transaction patterns to keep transactions short.