pg_locks data may be inconsistent during collection due to fast-path locks
infopg_locks data is not guaranteed to be entirely consistent because fast-path locks (fastpath=true) are gathered from each backend one at a time without freezing the entire lock manager state. Locks can be taken or released while information is being gathered. Regular lock manager and predicate lock manager snapshots are atomic but not locked simultaneously.
When analyzing pg_locks for lock contention, account for potential inconsistencies in the data. Fast-path locks are known not to conflict with other locks currently in place, so focus diagnostic efforts on regular locks (fastpath=false or null). For critical lock analysis, query pg_locks multiple times and look for persistent patterns rather than single-point-in-time snapshots. Use granted=false as the primary indicator of actual contention.