pg_show_plans
show query plans of all currently running SQL statements
Repository
cybertec-postgresql/pg_show_plans
https://github.com/cybertec-postgresql/pg_show_plans
Source
pg_show_plans-2.1.8.tar.gz
pg_show_plans-2.1.8.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_show_plans | 2.1.8 | STAT | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6210 | pg_show_plans | No | Yes | Yes | Yes | No | Yes | - |
| Related | pg_stat_plans auto_explain explain_ui pg_stat_statements pg_store_plans pg_overexplain pg_qualstats online_advisor pgrowlocks pg_wait_sampling |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.1.8 | 1817161514 | pg_show_plans | - |
| RPM | PGDG | 2.1.8 | 1817161514 | pg_show_plans_$v | - |
| DEB | PGDG | 2.1.8 | 1817161514 | postgresql-$v-show-plans | - |
Install
You can install pg_show_plans directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Preload:
Create Extension:
Usage
pg_show_plans displays the execution plans of all currently running SQL statements in real time. Plans are stored in a shared memory hash table.
Viewing Running Plans
The views return:
| Column | Type | Description |
|---|---|---|
pid | integer | Server process ID |
level | integer | Query nest level (0 = top level) |
userid | oid | User OID |
dbid | oid | Database OID |
plan | text | Query plan text |
query | text | Query string (only in pg_show_plans_q) |
Nested Queries
When a function invokes SQL statements, they appear at deeper nesting levels:
GUC Parameters
| Parameter | Default | Description |
|---|---|---|
pg_show_plans.plan_format | text | Output format: text, json, yaml, xml |
pg_show_plans.max_plan_length | 16384 | Max plan length in bytes (affects shared memory) |
pg_show_plans.is_enabled | true | Enable or disable the extension at runtime |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)