select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Extensions / Monitoring

pg_stat_statements

track planning and execution statistics of all SQL statements executed

pgext.cloud · Website · Documentation · License text · Control file

Overview

Packagepg_stat_statements
Version1.11
PostgreSQL versions14 · 15 · 16 · 17 · 18
RepositoryPostgreSQL contrib
Extension typePreloaded
Requires CREATE EXTENSIONYes
Requires preloadYes
TrustedNo
Shared librariespg_stat_statements
Latest commit2026-05-14
Latest release2026-05-14
Catalogue updated2026-07-29

Related extensions

Required by

gbdchecksDatabase health-check functions and views for bloat, locks, query statistics, and privileges.
pg_dbwaAnalyzes local or remote PostgreSQL workloads using historical pg_stat_statements snapshots.
pg_eyesSQL monitoring functions and views for PostgreSQL database activity
pg_get_queryidget last queryid generated/used by pg_stat_statements for a given backend pid
pg_logqueryidLogs pg_stat_statements query IDs alongside auto_explain output.
pg_shared_plansProof-of-concept shared-memory execution-plan cache for PostgreSQL
pg_sortstatsCollect per-query sort statistics and estimate required work_mem
pg_stat_kcacheKernel statistics gathering
pgtelemetryProvides monitoring views and functions for PostgreSQL activity, storage, locks, replication, WAL, vacuum, and query statistics.
powaPostgreSQL Workload Analyser-core
stat_recordBackground-worker snapshot recorder and reporting suite for PostgreSQL server statistics.

See also

pg_stat_plansTrack per-plan call counts, execution times, and example EXPLAIN texts.
pg_profilePostgreSQL load profile repository and report builder
pg_stat_monitorThe pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL contrib module pg_stat_statements. pg_stat_monitor provides aggregated statistics, client information, plan details including plan, and histogram information.
pg_store_planstrack plan statistics of all SQL statements executed
auto_explainProvides a means for logging execution plans of slow statements automatically
pg_show_plansshow query plans of all currently running SQL statements
powaPostgreSQL Workload Analyser-core
explain_uieasily jump into a visual plan UI for any SQL query
pg_qualstatsAn extension collecting statistics about quals
online_advisorSuggest missing indexes and extended statistics online
pg_relusageLog all the queries that reference a particular column
pg_wait_samplingsampling based statistics of wait events