How to read PostgreSQL EXPLAIN output and interpret its estimates
The article explains how to read a PostgreSQL EXPLAIN plan as a tree, moving from leaf scan nodes up to the root. It describes the cost, row, and width fields as planner estimates based on statistics and configurable cost parameters, not as measured results. It then covers EXPLAIN ANALYZE, which executes the statement and adds actual time, rows, and loops for comparison. The guide advises checking for early stops and repeated loops before concluding that an estimate is wrong, and warns that a single plan does not establish a root cause. It also notes that rolling back a transaction does not undo sequence advances or resource consumption.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in