explain_ui

easily jump into a visual plan UI for any SQL query

Overview

PackageVersionCategoryLicenseLanguage
pg_explain_ui0.0.2STATPostgreSQLRust
IDExtensionBinLibLoadCreateTrustRelocSchema
6540explain_uiNoYesNoYesYesNo-
Relatedpg_show_plans auto_explain pg_stat_statements pg_hint_plan pg_qualstats pg_store_plans pg_profile powa

manual updated pgrx by Vonng

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.0.21817161514pg_explain_ui-
RPMPIGSTY0.0.21817161514pg_explain_ui_$v-
DEBPIGSTY0.0.21817161514postgresql-$v-pg-explain-ui-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
el10.aarch64
d12.x86_64
d12.aarch64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
d13.x86_64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
d13.aarch64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
u22.x86_64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
u22.aarch64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
u24.x86_64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
u24.aarch64
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2
PIGSTY 0.0.2

Build

You can build the RPM / DEB packages for pg_explain_ui using pig build:

pig build pkg pg_explain_ui         # build RPM / DEB packages

Install

You can install pg_explain_ui directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pg_explain_ui;          # Install for current active PG version
pig ext install -y pg_explain_ui -v 18  # PG 18
pig ext install -y pg_explain_ui -v 17  # PG 17
pig ext install -y pg_explain_ui -v 16  # PG 16
pig ext install -y pg_explain_ui -v 15  # PG 15
pig ext install -y pg_explain_ui -v 14  # PG 14
dnf install -y pg_explain_ui_18       # PG 18
dnf install -y pg_explain_ui_17       # PG 17
dnf install -y pg_explain_ui_16       # PG 16
dnf install -y pg_explain_ui_15       # PG 15
dnf install -y pg_explain_ui_14       # PG 14
apt install -y postgresql-18-pg-explain-ui   # PG 18
apt install -y postgresql-17-pg-explain-ui   # PG 17
apt install -y postgresql-16-pg-explain-ui   # PG 16
apt install -y postgresql-15-pg-explain-ui   # PG 15
apt install -y postgresql-14-pg-explain-ui   # PG 14

Create Extension:

CREATE EXTENSION explain_ui;

Usage

explain_ui: generate visual explain plan URLs from SQL

explain_ui provides a function that takes a SQL query, runs EXPLAIN on it, and uploads the plan to Dalibo’s explain visualizer, returning a shareable URL.

Function

SELECT explain_ui($$
  SELECT b.title, a.name, p.name
  FROM books b
  INNER JOIN authors a ON b.author_id = a.author_id
  INNER JOIN publishers p ON b.publisher_id = p.publisher_id
  ORDER BY b.publication_date DESC
$$);

                    explain_ui
--------------------------------------------------
 https://explain.dalibo.com/plan/ccg2e5fedd913bb7

The function:

  1. Runs EXPLAIN (FORMAT JSON) on the provided SQL query
  2. Uploads the plan to explain.dalibo.com
  3. Returns a URL to the visual plan representation

The visualizer is built on pev2 (PostgreSQL Explain Visualizer 2), providing an interactive graphical view of query execution plans.


Last Modified 2026-03-12: add pg extension catalog (95749bf)