PostgreSQL Wait Event Lookup
pg_stat_activity tells you what each session is waiting for through wait_event_type and wait_event, but names like LWLock:BufferMapping, IPC:SyncRep or Lock:tuple are hard to read at 3 a.m. Search any of the 274 wait events from PostgreSQL 18.7 (with their official descriptions), or paste a pg_stat_activity sample and get a ranked breakdown: what each wait means, whether it is normal, the query to dig further and what usually fixes it. Everything runs in your browser.
Do more than postgresql wait event lookup — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Run the sampling query below in psql (add \watch 1 to repeat it) or copy rows from pg_stat_activity, AWS Performance Insights (Lock:transactionid style) or your monitoring tool.
- Paste the output. The tool counts each wait event, uses the count column if there is one, and treats active sessions with no wait event as running on CPU.
- Read the ranked list: background and normal waits sink to the bottom, and each real wait shows its meaning, a follow-up query and the usual fix. Use the search box to look up a single event.
Frequently asked questions
What does a NULL wait_event mean in pg_stat_activity?
For a session with state = active, a NULL wait_event means it is not waiting at all: it is running on the CPU (or in a code path that does not report a wait). For idle sessions you normally see Client:ClientRead instead, because the backend is waiting for the client to send the next query.
What is the difference between Lock and LWLock wait events?
Lock events are heavyweight locks on SQL-level objects: tables (relation), rows (transactionid, tuple), advisory locks and so on. They show up in pg_locks and can be waited on for a long time. LWLock events are lightweight locks that protect shared-memory structures such as the buffer mapping table or WAL buffers. They are held for microseconds, so they only matter when many sessions show the same one at the same time.
Where do I find the list of wait events on my server?
On PostgreSQL 17 and newer, run SELECT type, name, description FROM pg_wait_events; which also includes wait events registered by extensions. On older versions, the list is in the "Wait Event" tables of the Monitoring Database Activity chapter in the documentation. This tool uses the PostgreSQL 18.7 list and marks the nine events that are new in 18, such as IO:AioIoCompletion.
