PostgreSQL · MySQL · query tuning
See where the query actually spends its time.
Paste a PostgreSQL EXPLAIN (ANALYZE, BUFFERS) or MySQL EXPLAIN ANALYZE tree. SQLPlan rebuilds the plan as a tree, separates each node's own time from its children's, flags sequential scans, nested-loop rescans and disk spills, proposes indexes, and formats or lints the SQL. Nothing leaves this page.
- EXPLAIN ANALYZE
- Buffers
- Disk spill
- Index suggestions
- SQL formatter
Execution plan
Text format only. The plan is parsed locally; no database connection is made.
Summary
Plan tree
| Node | Self time | Rows (act / est) | Loops |
|---|---|---|---|
| Paste a plan and press Analyze. | |||
The bar is self time as a share of execution time. Select a row to see filters, buffers and sort details.
SQL
SQL formatter and linter
Formatting is whitespace and keyword case only; it does not change semantics.
Formatted SQL
—
Method
What the analyzer measures
Self time, not just total
A node's total time includes its children. SQLPlan subtracts the children (multiplied by their loops) so the bar shows the time spent in that node itself, which is where an index or a rewrite actually helps.
Estimates against reality
Each row shows actual rows per loop next to the planner's estimate. A ratio above ten usually means stale statistics, a correlation the planner cannot see, or a predicate it cannot estimate — and every join above it inherits the error.
Disk is the expensive part
Sorts that spill to external merge, hash batches above one, and temp blocks read or written are flagged first. They turn a memory operation into I/O and are often fixed by an index, a smaller row width or a work_mem change.
Guides