Skip to main content

Top Wait Events

The Top Wait Events panel shows the distribution of wait events observed across all ASH samples in the selected time window. It helps you understand what your database sessions were waiting for — the single most important diagnostic dimension in ASH analysis.

{screenshot: ash-top-wait-events-panel}


Understanding Wait Events

In PostgreSQL, a session that is not actively using CPU is in a wait state. The pg_stat_activity view exposes two fields:

  • wait_event_type — the category of wait (Lock, IO, IPC, Client, Timeout, etc.)
  • wait_event — the specific event within that category

PMP4PG captures both fields in every ASH sample, allowing you to see not just that sessions were waiting, but what they were waiting for.


Panel Layout

The Top Wait Events panel displays:

Summary Chart

A horizontal bar chart or donut chart showing the proportion of ASH samples attributed to each wait event type across the selected period.

{screenshot: ash-wait-events-chart}

Wait Events Table

A ranked table of the top individual wait events:

ColumnDescription
RankPosition by sample count
Wait Event TypeCategory (Lock, IO, IPC, Client, Timeout, Other)
Wait EventSpecific event name
SamplesNumber of ASH samples with this wait event
% of TotalProportion of all samples

{screenshot: ash-wait-events-table}


Common Wait Events and Their Meaning

Wait EventTypeTypical Cause
relationLockRow or table lock contention
transactionidLockTransaction waiting for another transaction to commit
DataFileReadIOReading data blocks from disk (cache miss)
WALWriteIOWaiting for WAL to be written to disk
ClientReadClientWaiting for the client to send data
ClientWriteClientWaiting for the client to receive data
BgWriterHibernateIPCBackground writer sleeping (low activity)

Session States

Below the wait events table, a Session States breakdown shows the distribution of:

StateDescription
ActiveExecuting a query
IdleConnected but doing nothing
Idle in transactionIn an open transaction, not executing
Idle in transaction (aborted)In a failed transaction, not yet rolled back

{screenshot: ash-session-states-breakdown}

A high proportion of idle in transaction sessions may indicate application connection management issues or long-running transactions.


Next Steps