finds.dev

mgartner/pg_flame

A flamegraph generator for Postgres EXPLAIN ANALYZE output.

View on GitHub

★ 1,620GoApache-2.0updated Jan 2020

// the take

pg_flame turns Postgres EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) output into an interactive flamegraph HTML file, so you can see where a slow query is actually spending its time instead of squinting at a plan tree. It's for anyone doing ad-hoc query performance debugging who wants a visual instead of reading nested EXPLAIN output.

Does one thing with a clean Unix pipe interface: JSON plan in on stdin, self-contained HTML out on stdout, so it drops straight into a psql | pg_flame > file.html pipeline with no server or config. Output is a static HTML file you can open locally or host anywhere — no runtime dependency once generated. Small Go codebase (plan parsing and HTML templating are the only two packages) that's easy to read end to end in a sitting. Ships binaries, a Homebrew tap, and a Docker image, so install friction is low regardless of platform.

No commits since January 2020 — six years stale, with no indication it tracks changes to Postgres's EXPLAIN JSON format across major versions (parallel workers, incremental sort, memoize nodes, etc. added since then may render wrong or not at all). It hard-depends on the third-party spiermar/d3-flame-graph JS plugin for rendering, which is itself abandoned, so you're trusting unmaintained front-end JS baked into every generated HTML file. It's CLI-only with no library/API surface, so anything beyond manual one-off debugging (a dashboard, a CI performance gate) means wrapping the binary yourself. Test coverage is limited to basic plan/html unit tests, with nothing visible for edge cases like truncated plans or buffers-disabled output, so malformed input handling is unverified.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,620
Forks
36
Language
Go
License
Apache-2.0
Last commit
13 Jan 2020

// nearby

If pg_flame isn't quite it.

All repos →