How to Read EXPLAIN ANALYZE in PostgreSQL
EXPLAIN shows how PostgreSQL plans to run a query. EXPLAIN ANALYZE actually runs it and adds real timings. It's the most important tool for fixing slow SQL. Run it EXPLAIN (ANALYZE, BUFFERS) SELECT o.id, o.total_paise FROM orders o WHERE o.customer_id = 42 AND...