PostgreSQL Performance Analytics Extension
Gain instant visibility into query latency, cache efficiency, I/O, and WAL pressure. pg_stat_insights collects 52 metrics across 11 curated views, making it a drop-in upgrade from pg_stat_statements with richer diagnostics.
Key Capabilities
52 Deep Metrics
Collect extended plan, execution, IO, WAL, and JIT metrics for faster root cause analysis.
11 Curated Views
Purpose-built views for cache efficiency, IO profiling, parallel query tuning, and more.
Drop-in Upgrade
Extends pg_stat_statements semantics, keeps the same reset functions, and integrates with existing dashboards.
Documentation Library
Overview & Setup
Install pg_stat_insights, enable tracking, and understand the metric catalog.
- Getting Started
Install the extension, enable shared_preload_libraries, and verify metrics are populated.
- Configuration
Tune tracking scope, retention, and planning metrics for production workloads.
- Metrics Overview
Explore all 52 metric columns and how to interpret them.
Performance Deep Dives
Investigate cache, IO, parallelism, WAL, and slow query behaviour with targeted guides.
- Cache Efficiency
Measure cache hit ratios and identify statements that thrash shared buffers.
- I/O Performance
Analyse block read/write timing and detect temp file spillovers.
- Parallel Queries
Review parallel worker usage and evaluate speedups versus overhead.
- WAL Monitoring
Track WAL volume per query and tune write-heavy workloads.
Operations & Monitoring
Integrate with observability stacks, automate resets, and export metrics to dashboards.
- Usage & Reset Patterns
Copy/paste SQL snippets for investigations and schedule safe resets.
- Monitoring & Alerts
Wire metrics into Prometheus/Grafana and configure alert rules.
- Troubleshooting
Fix preload errors, missing metrics, excessive overhead, and reset issues.
- Views Reference
Reference for the eleven curated views bundled with pg_stat_insights.
Quick Links
Getting Started Guide
Enable pg_stat_insights and validate metrics within five minutes.
Learn moreConfiguration Reference
Learn how to adjust tracking scope, retention, and planning metrics.
Learn moreTroubleshooting Playbook
Step-by-step fixes for missing metrics, overhead, and reset problems.
Learn moreMetrics Deep Dive
Understand every column exposed by pg_stat_insights for dashboards.
Learn more