Skip to main content


Short Description

The pg_stat_statements module provides a means for tracking planning and execution statistics of all SQL statements executed by a server.

Detailed Description

The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql.conf, because it requires additional shared memory. This means that a server restart is needed to add or remove the module.

When pg_stat_statements is loaded, it tracks statistics across all databases of the server. To access and manipulate these statistics, the module provides a view, pg_stat_statements, and the utility functions pg_stat_statements_reset and pg_stat_statements. These are not available globally but can be enabled for a specific database with CREATE EXTENSION pg_stat_statements.

How to reduce this wait

N/A - this is an additional module.

PostgreSQL documentation - Appendix F. Additional Supplied Modules

Blog article - The most useful Postgres extension: pg_stat_statements

Search online

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.