Blocking locks cause query delays and timeouts
criticalResource ContentionUpdated Jan 30, 2026
Technologies:
How to detect:
Locks held by one session prevent other sessions from acquiring required locks, causing queries to wait or timeout
Recommended action:
Use the provided query against pg_locks and pg_stat_activity to identify blocking and blocked sessions. Review the blocking query to determine if it can be optimized or committed faster. Consider terminating the blocking session if it's hung or no longer needed. Monitor lock wait times and set alerts for prolonged blocking.