# How I read EXPLAIN ANALYZE

> Three numbers I look at first, and the one I used to look at and now ignore.

- URL: https://personal-example.notra.site/blog/reading-explain-analyze
- Published: 2026-09-09
- Tags: postgres

A query plan is a tree, and most of it is fine. I look for the node where the estimate and reality disagree.

## The three numbers

1. **Estimated rows vs. actual rows.** If the planner expected 12 rows and got 480,000, everything above that node was planned for the wrong world. Fix the statistics first.
2. **Loops.** `actual time=0.02..0.03 rows=1 loops=95000` looks cheap until you multiply. That is a nested loop doing 95,000 index lookups.
3. **Buffers.** Run with `explain (analyze, buffers)`. `shared read` means disk. `shared hit` means cache. A slow query with only hits is CPU-bound, and an index won’t save it.

## The one I ignore

Total cost. It is in planner units, not milliseconds, and comparing it between two different queries tells you nothing.

> **Tip**
>
> Paste plans into a visualizer like explain.dalibo.com when the tree is deeper than one screen. It highlights the slowest node for you.
