Posts

aaa

PostgreSQL 19 — Monitoring Lock Contention and Fast-Path Overflow with pg_stat_lock

  PostgreSQL 19 introduces the pg_stat_lock view, which provides cumulative statistics about lock activity across the database cluster. It helps database administrators investigate lock contention, measure time spent waiting for locks, and identify situations where relation locks exceed the available fast-path slots. In this article, I will demonstrate these capabilities through two practical scenarios. postgres = # \d pg_stat_lock View "pg_catalog.pg_stat_lock" Column | Type | Collation | Nullable | Default -------------------+--------------------------+-----------+----------+--------- locktype | text | | | waits | bigint | | | wait_time | double precision | | | fastpath_exceeded | bigint | | | stats_reset | timestamp...