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:
| Column | Description |
|---|---|
| Rank | Position by sample count |
| Wait Event Type | Category (Lock, IO, IPC, Client, Timeout, Other) |
| Wait Event | Specific event name |
| Samples | Number of ASH samples with this wait event |
| % of Total | Proportion of all samples |
{screenshot: ash-wait-events-table}
Common Wait Events and Their Meaning
| Wait Event | Type | Typical Cause |
|---|---|---|
relation | Lock | Row or table lock contention |
transactionid | Lock | Transaction waiting for another transaction to commit |
DataFileRead | IO | Reading data blocks from disk (cache miss) |
WALWrite | IO | Waiting for WAL to be written to disk |
ClientRead | Client | Waiting for the client to send data |
ClientWrite | Client | Waiting for the client to receive data |
BgWriterHibernate | IPC | Background writer sleeping (low activity) |
Session States
Below the wait events table, a Session States breakdown shows the distribution of:
| State | Description |
|---|---|
| Active | Executing a query |
| Idle | Connected but doing nothing |
| Idle in transaction | In 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.