pg_stat_insights

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.