Introduction
EXPLAIN ANALYZE helps you see how a database runs your query and how long each step takes. It shows the real work done, not just the plan.
When you want to find out why a query is slow.
When you want to see how the database processes your query step-by-step.
When you want to compare different ways of writing a query to find the fastest one.
When you want to check if indexes are being used properly.
When you want to understand the cost and time of each part of your query.