LabPostgreSQL Query Plan Explorer

PostgreSQL Query Plan Explorer

Explore execution plans, compare estimates with actual statistics, and inspect potential bottlenecks.

Runs in your browser
First time here?Quick start & guided walkthrough

Explore a PostgreSQL JSON plan, then compare a second measured run without confusing estimated cost with time.

  1. Start with a JSON planLoad the example, or paste EXPLAIN (FORMAT JSON) output. Plans produced with ANALYZE can include measured rows and timings; estimated-only plans cannot provide those measurements.
  2. Build the plan treeExplore the plan to inspect scans, joins, and row estimates. Expand nodes to compare estimated and actual rows where those fields are available.
  3. Compare like with likeAdd an After plan for the same query and representative conditions, then explore again. Measured execution time and estimated cost remain separate values.

Load an example or enter your own input to begin.

How to use this tool

Use EXPLAIN (FORMAT JSON) to obtain estimates, or EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) when it is appropriate to execute and measure your query. Paste one plan, optionally add a comparison, and explore the tree.

Expand a node to inspect its supplied fields. The sample is an invented plan used to demonstrate row-estimate differences, not a benchmark from an employer.

How it works

Planner cost, estimated rows, actual rows, actual time, loops, and buffer fields retain their reported units. Row-estimate differences and temporary block activity generate conditional review prompts.

Comparisons match nodes by tree position. Plan structure changes may make those positions represent different operations, so inspect the tree as well as numeric deltas.

Scope and limitations

  • Planner cost is not milliseconds. Actual time and rows are reported per loop, and parent timings include child work.
  • Only one top-level plan per input is supported, up to 2,000 nodes and 60 levels. No database connection is made.
  • EXPLAIN ANALYZE executes the statement. Obtain plans using your own appropriate environment and permissions. Optimization depends on query semantics, table size, data distribution, and workload.

Technical references

Discuss the engineering behind this tool

Your input stays in this tab. These tools do not upload, store, or send it to an AI service.

Try “PostgreSQL”, “testing”, or “architecture”.