pg_stat_insights
Query planning/execution statistics with replication, index, trend, and contention analysis.
pg_stat_insights · Query planning/execution statistics with replication, index, trend, and contention analysis.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101932 | pg_stat_insights | pg_stat_insights | 3.0 | STAT | MIT | C |
PostgreSQL · 16, 17, 18
Usage
Sources:
pg_stat_insights Query planning/execution statistics with replication, index, trend, and contention analysis.
Enablement
Merge pg_stat_insights into the existing preload list, restart PostgreSQL, and then create pg_stat_insights in each database that needs its SQL objects:
Core Workflow
The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.
Main Objects
The reviewed install surface includes these prominent objects:
| Object | Kind | Operational role |
|---|---|---|
pg_stat_insights_top_by_time | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_by_bucket | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_errors | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_histogram_summary | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_index_by_bucket | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_index_size_by_bucket | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_plan_errors | VIEW | Inspection or query view created by the extension. |
pg_stat_insights_replication_by_bucket | VIEW | Inspection or query view created by the extension. |
Operations and Boundaries
- The verified PostgreSQL-major evidence covers 16, 17, 18; do not infer unlisted majors.
- Preloading
pg_stat_insightschanges cluster startup state; stage configuration and restart changes separately fromCREATE EXTENSION.