explain_ui
easily jump into a visual plan UI for any SQL query
Repository
davidgomes/pg-explain-ui
https://github.com/davidgomes/pg-explain-ui
Source
pg_explain_ui-0.0.2.tar.gz
pg_explain_ui-0.0.2.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_explain_ui | 0.0.2 | STAT | PostgreSQL | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6540 | explain_ui | No | Yes | No | Yes | Yes | No | - |
| Related | pg_show_plans auto_explain pg_stat_statements pg_hint_plan pg_qualstats pg_store_plans pg_profile powa |
|---|
manual updated pgrx by Vonng
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.0.2 | 1817161514 | pg_explain_ui | - |
| RPM | PIGSTY | 0.0.2 | 1817161514 | pg_explain_ui_$v | - |
| DEB | PIGSTY | 0.0.2 | 1817161514 | postgresql-$v-pg-explain-ui | - |
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 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:
- Runs
EXPLAIN (FORMAT JSON)on the provided SQL query - Uploads the plan to explain.dalibo.com
- 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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.