Analysis updated 2026-05-18
Turn a PostgreSQL EXPLAIN ANALYZE output into a plain language report with concrete fixes.
Catch query plan regressions automatically in a CI pipeline by diffing two plans.
Connect to a live database and safely run EXPLAIN to diagnose a slow query.
Monitor live database lock contention to find what is blocking what.
| losefor/pg-explain | adun-denton/chinvat | agbara286/saint-cms | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | moderate | easy |
| Complexity | 3/5 | 4/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Node.js version 22 or newer, connecting to a live database needs the optional pg driver.
pg-explain, distributed as the npm package pgexplain, takes the technical output PostgreSQL databases produce when you ask them to explain how they will run a query, and turns it into a human readable report. Database query plans are usually dense and full of jargon, so most tools that display them simply show you the raw tree of steps without telling you whether anything is actually wrong. This tool goes further by running an advisor over the plan that looks for known problem patterns, and for each one it finds it explains what happened, why it matters, and exactly how to fix it, often including a ready to copy SQL command such as the specific index to create. The tool can detect eighteen different kinds of query plan problems, including scans that read far more of a table than needed, sorts and other operations that spill to disk because they ran out of memory, tables whose statistics are outdated and are causing the database to misjudge how much data a step will touch, and risky database changes that could lock a table for longer than expected. It can also show a live snapshot of which database operations are currently blocked and waiting on each other. It works as a command line tool that can read a saved plan from a file, accept one piped in from the terminal, connect directly to a database and safely run a query in read only mode, or compare two plans against each other to catch a performance regression, which is useful in an automated testing pipeline. Reports can be produced in several formats including plain terminal output, Markdown, HTML, and JSON. There is also an optional local web interface called Studio that runs entirely on your own computer, showing an interactive, color coded diagram of the query plan, a history of past runs, and side by side comparisons between them. Any saved database passwords are stored using your operating system's secure credential storage when available. The tool requires Node.js version 22 or newer and is released under the MIT license.
A CLI and web tool that turns PostgreSQL query plans into readable reports and flags performance problems with concrete fixes.
Mainly TypeScript. The stack also includes TypeScript, Node.js, PostgreSQL.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.