How to Read a PostgreSQL EXPLAIN Plan
Read a PostgreSQL EXPLAIN plan node by node, from costs and row estimates to scan and join types, EXPLAIN ANALYZE and BUFFERS, plus MySQL basics.
Blog / Category
Practical guides to finding out why a query is slow and what to change. Posts here start from evidence (logs, statistics, plans) rather than guesses, and show how to read them in PostgreSQL and MySQL.
Read a PostgreSQL EXPLAIN plan node by node, from costs and row estimates to scan and join types, EXPLAIN ANALYZE and BUFFERS, plus MySQL basics.
An N+1 query is one query for a list plus one more per row. Learn how to spot it, three ways to fix it, and when it is harmless.