pg_what_is_happening
pg_what_is_happening · Live execution metrics for individual query plan nodes
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102193 | pg_what_is_happening | pg_what_is_happening | 1.1 | STAT | GPL-3.0-only | C |
PostgreSQL · 9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18
Usage
Sources:
pg_what_is_happening exposes live execution and buffer metrics for active queries. Upstream claims PostgreSQL 9.4 through 18 and newer, but explicitly does not guarantee a stable library ABI.
Core Workflow
Operational Boundaries
Preload and restart are mandatory; extension creation requires a superuser. what_is_happening.v1_status reports one row per active plan node. The shipped SQL grants the view and its backing function to PUBLIC, so review access to query text. The optional background worker exposes /metrics, defaulting to localhost port 9187; protect that endpoint. what_is_happening.min_cost_to_track filters cheap queries. Limits on tracked queries, nodes and query-text length require restart, while enablement and signal timeout can reload. Completed queries disappear; this is not a historical statistics store.