Skip to content

Menu

SQL EXPLAIN Visualizer

Visualize SQL EXPLAIN output

Runs entirely in your browserDatabaseFree, no sign-up
Loading tool

01What is SQL EXPLAIN Visualizer?

A slow query in PostgreSQL usually comes with a wall of EXPLAIN ANALYZE text, and reading it line by line is tiring. This visualizer turns that text into a tree of cards, one per plan node, so you can see where the time and rows go. You can paste either the default text format or the output of EXPLAIN (FORMAT JSON). If the input starts with a bracket or brace, it is parsed as JSON. Otherwise the text parser takes over. In text mode, a line counts as a plan node when it carries a (cost=...) or (actual ...) block. The arrow and its indentation decide which parent a node belongs to. The parser skips the QUERY PLAN header, the dashed rule and the "(N rows)" footer that psql prints. Lines like Filter, Index Cond, Sort Key or Buffers are attached as details to the node just above them. Index names and table aliases are kept, so "Index Scan using users_pkey on users u" stays readable. In JSON mode, the tree comes from Node Type, Relation Name, Alias, Index Name, the cost and row fields, and the nested Plans arrays. Keys such as Join Type, Hash Cond, Sort Key and the shared buffer counts show up as details. The field meanings follow the "Using EXPLAIN" chapter of the PostgreSQL documentation. Actual rows are per loop, exactly as Postgres reports them. The time on each card is the node's total time multiplied by its loops, so an inner index scan that runs 2,000 times is not hidden. Here is a real case from the built-in Nested Loop sample. The inner "Index Scan using users_pkey" reports 0.001 ms per loop with loops=2000. The card shows 2.000 ms, which is far more honest than 0.001. Two warnings are raised. One fires when a Seq Scan returns more than 1,000 rows in total. The other fires when the estimated and actual row counts differ by 10x or more, which often means stale statistics. Neither is a verdict. A sequential scan is the right plan for a small table or a query that reads most rows. Some limits to keep in mind. YAML and XML formats are not parsed. Plain EXPLAIN without ANALYZE works, but the summary then shows 0 ms for planning and execution because those lines are absent. Parsing happens in the page itself, and plan text is rendered as plain text, so your table names and filter values never leave the tab. Copy JSON gives you the parsed tree for notes or tickets.

Backend developers and DBAs who need to see, in a minute, which PostgreSQL plan node is slow and whether the planner guessed the row counts right. The tool runs entirely in your browser, so your data never leaves your device.

02How to use SQL EXPLAIN Visualizer

  1. In psql or your SQL client, run EXPLAIN (ANALYZE, BUFFERS) or EXPLAIN (ANALYZE, FORMAT JSON) on your query.
  2. Paste the whole result into EXPLAIN ANALYZE Output (text or FORMAT JSON), or load the Sequential scan, Index scan or Nested Loop JOIN example.
  3. Read the summary line for Format, Planning, Execution and Top-level nodes.
  4. Walk down the tree and check cost, time, est. rows, actual rows, loops, details and any yellow warnings on each card.
  5. Click Copy JSON if you want to keep the parsed structure.

03Worked examples

Input: Seq Scan on users (cost=0.00..35.50 rows=2550 width=36) (actual time=0.012..0.150 rows=2500 loops=1) Filter: (active = true) Rows Removed by Filter: 500 Planning Time: 0.150 ms Execution Time: 0.350 ms
Result: Seq Scan | users | cost 35.50 | time 0.150ms est. rows 2550, actual 2500 Filter: (active = true) Rows Removed by Filter: 500 Warning: Sequential scan returning many rows Planning 0.15ms, Execution 0.35ms
2,500 rows is over the 1,000-row threshold. The estimate is close, so no estimate warning. Warning text trimmed.
Input: Index Scan using idx_orders_user on orders (cost=0.29..8.31 rows=1 width=40) (actual time=0.020..0.900 rows=120 loops=1) Index Cond: (user_id = 42) Execution Time: 1.000 ms
Result: Index Scan using idx_orders_user | orders | cost 8.31 | time 0.900ms est. rows 1, actual 120 Index Cond: (user_id = 42) Warning: Row estimate off by 120x (estimated 1, actual 120)
Index scans are not flagged as scans, but a 10x or larger estimate gap is. Warning text trimmed.
Input: Nested Loop JOIN sample (Sort > Nested Loop > Seq Scan on orders o + Index Scan using users_pkey on users u, loops=2000)
Result: Sort (time 2.650ms) Nested Loop (time 1.200ms) Seq Scan | orders o | time 0.300ms | warning: many rows Index Scan using users_pkey | users u | time 2.000ms | actual 1 per loop | loops 2000
0.001 ms per loop times 2000 loops is shown as 2.000 ms. Output condensed to type, table and time.
Input: [{"Plan":{"Node Type":"Hash Join","Join Type":"Inner","Total Cost":40.2,"Plan Rows":10,"Actual Rows":400,"Actual Loops":1,"Actual Total Time":2.5,"Hash Cond":"(o.user_id = u.id)","Plans":[{"Node Type":"Seq Scan","Relation Name":"orders","Alias":"o","Plan Rows":500,"Actual Rows":500,"Actual Loops":1,"Total Cost":20}]},"Planning Time":0.2,"Execution Time":2.9}]
Result: Format: json, Planning 0.2ms, Execution 2.9ms Hash Join | cost 40.20 | est. rows 10, actual 400 Join Type: Inner, Hash Cond: (o.user_id = u.id) Warning: Row estimate off by 40x Seq Scan | orders o | est. rows 500, actual 500
JSON input is detected from the leading bracket. Hand-trimmed plan, condensed output.
Input: Seq Scan on logs (cost=0.00..20.00 rows=50 width=8)
Result: Seq Scan | logs | cost 20.00 | est. rows 50 Planning 0ms, Execution 0ms, no warnings
Plain EXPLAIN has no actual numbers, so the estimate check is skipped and the timing summary reads 0.

04Common use cases

  • Finding which node of a 12-table report query is the Seq Scan that eats most of the runtime
  • Checking that a new index on orders.user_id actually turns a Seq Scan into an Index Scan
  • Spotting an inner loop with loops=2000 whose tiny per-loop time hides seconds of total work
  • Catching a Hash Join whose row estimate is 40x off before blaming the join itself
  • Pasting a plan into a code review or incident ticket as a readable tree via Copy JSON
  • Teaching juniors how cost, rows and loops relate in a real PostgreSQL plan

05Tips

  • EXPLAIN ANALYZE really executes the statement, so wrap an UPDATE or DELETE in BEGIN and ROLLBACK before you profile it.
  • When a card says "per loop", multiply actual rows by loops before you compare it with the parent's row count.
  • A big estimate gap on a multi-column filter often comes from correlated columns. CREATE STATISTICS can give the planner what it is missing.
  • Paste the full psql output, footer and all. The header, dashed line and row-count footer are skipped for you.
  • Prefer FORMAT JSON for very long plans, since it avoids any ambiguity in indentation.

06Related concepts

Query plan, EXPLAIN ANALYZE, Sequential scan, Index scan, Planner statistics.

Frequently Asked Questions

What is SQL EXPLAIN Visualizer?

SQL EXPLAIN Visualizer is a free, browser-based developer tool on AIDToolStack. Visualize SQL EXPLAIN output It requires no installation or sign-up and works entirely in your browser.

Is SQL EXPLAIN Visualizer free to use?

Yes. No sign-up, no fees and no usage cap.

Does SQL EXPLAIN Visualizer store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe