July 10, 2026 - Version 2026.07 has been released
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

This project is a fork of https://github.com/ossc-db/pg_store_plans

About

This extension is OPTIONAL.

Datasentinel will automatically consider it if it is installed

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

Ensure PostgreSQL development package is installed

On RHEL based systems:

PostgreSQL provides the pg_config utility to allow to verify that build settings are available and correctly resolved.

Download Source Files

PostgreSQL version
pg_store_plans version
Download file url

14, 15, 16, 17, 18

2.0.1

Unpack the source code

Build and install the extension

For Versions less than 14
PostgreSQL version
pg_store_plans version
Download file url

< 10

1.3.1

>= 10 and < 13

1.4

13

1.5

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