Skip to content

pg_what_is_happening

Live execution metrics for individual query plan nodes

pg_what_is_happening · Live execution metrics for individual query plan nodes

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102193pg_what_is_happeningpg_what_is_happening1.1STATGPL-3.0-onlyC

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

shared_preload_libraries = 'pg_what_is_happening'
CREATE EXTENSION pg_what_is_happening;
SELECT * FROM what_is_happening.v1_status;

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.

Table reader