Skip to content

EXPLAIN plan

An EXPLAIN plan is the database's description of how it intends to run a query, shown as a tree of steps with cost estimates.

An EXPLAIN plan is the database’s description of how it intends to run a query. In PostgreSQL, the EXPLAIN command shows the plan the planner chose without running the query: a tree of plan nodes, each with estimated start-up cost, total cost, row count and row width.

EXPLAIN ANALYZE goes further: it actually executes the query and reports real timings next to the estimates. Because the query really runs, a data-modifying statement has real effects, which is why the PostgreSQL documentation suggests wrapping it in a transaction that you roll back.

SQLEye’s Explain button in the query detail panel never uses ANALYZE. It only runs a plain EXPLAIN, only for a running instance, and only for a single SELECT, INSERT, UPDATE or DELETE without errors. The plan appears as text under “Plan”. Reading plans often starts with spotting a sequential scan. See Explain.

← Glossary · Also available as Markdown.

SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.