---
title: "Discussion on \"PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans\" | Hashnode"
description: "Discussion on \"PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans\". PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans\nEvery slow query I have ever chased started the same way: someone guessing. \"Probably needs an index.\" \"The join is too big.\" \"Postgr"
url: "https://hashnode.com/posts/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans/6ad2bf0da305ffe66918c506"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans](https://parsaaftabi.hashnode.dev/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans?utm_source=hashnode&utm_medium=feed)

PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans Every slow query I have ever chased started the same way: someone guessing. "Probably needs an index." "The join is too big." "Postgr

Oct 17 · 8 min read · parsaaftabi.hashnode.dev  
Updated Nov 16  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#sql](https://hashnode.com/tag/sql)
-   [#database](https://hashnode.com/tag/database)
-   [#performance](https://hashnode.com/tag/performance)

## Written by

[Parsa Aftabi](https://hashnode.com/@parsaaftabi)

@parsaaftabi

  
[View profile](https://hashnode.com/@parsaaftabi)

I do computers, all the way down. Go and C++. I build small tools and write about how systems fail.

I do computers, all the way down. Backend and systems work in Go and C++, small open-source tools, and a low-level series on crash logs, page tables and kernel internals.

## Responses 2

Markdown supported · ⌘↵ to post

[StackShortlist](https://hashnode.com/@veristria)

[Oct 17](https://hashnode.com/posts/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans/6ad2bf0da305ffe66918c506/comment/6ad31e778c8e8c2df5b9ec26)

The point about fixing the estimate before tuning the query is the one that saves the most time. When ANALYZE is fresh and the gap still shows up on a filter over two related columns, like city and postal code, CREATE STATISTICS with dependencies can close it, since the planner assumes columns are independent by default. The BEGIN and ROLLBACK warning for UPDATE is worth having at the top too.

[Parsa Aftabi](https://hashnode.com/@parsaaftabi)

[Oct 17](https://hashnode.com/posts/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans/6ad2bf0da305ffe66918c506/comment/6ad31e778c8e8c2df5b9ec26#reply-6ad326937c50be855a189a35)

good point on extended statistics — that's the exact spot where the planner's independence assumption falls apart. should've given it its own section.
