pg_store_plans
The PostgreSQL extension pg_store_plans is a contrib module that provides a way to store execution plans generated by the query planner.
The open-source project is accessible on GitHub: https://github.com/datasentinel/pg_store_plans
PG_STORE_PLANS store execution plans like PG_STAT_STATEMENTS does for queries.
About
Once the settings are configured, there is no further action required. Resetting pg_store_plans is unnecessary.
Datasentinel collects execution plan activity metrics for all queries at regular intervals to enable detailed analyzes on the GUI.
Upon installation, you gain access to:
Historical statistics for each query ID's plan.
Execution plans.
Installation
Set the PATH variable to your PostgreSQL installation directory
PostgreSQL provides the pg_config utility to allow to verify that build settings are available and correctly resolved.
Download Source Files
14, 15, 16, 17, 18
2.0.1
Unpack the source code
Build and install the extension
Modify postgresql.conf
shared_preload_libraries
Add pg_store_plans to shared_preload_libraries parameter (requires a server restart)
Add the following lines
Restart PostgreSQL
Create The Extension
connect to the internal database named postgres with superuser privileges
Upgrading from Versions < 2.0
When upgrading from a version earlier than 2.0, the extension must be dropped and recreated.
Version 2.0 introduces a change in how planid values are computed, meaning the same execution plan will produce a different identifier than in previous versions.
Check The Extension
or
Check Parameters
Check Execution Plans
Connected as datasentinel user and in postgres database
Last updated