plugpg_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_plansarrow-up-right

PG_STORE_PLANS store execution plans like PG_STAT_STATEMENTS does for queries.

circle-info

About

circle-info

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

circle-exclamation

Set the PATH variable to your PostgreSQL installation directory

circle-info

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

Unpack the source code

Build and install the extension

chevron-rightFor Versions less than 14hashtag

Modify postgresql.conf

circle-info

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

circle-info

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