Execution Plan (EXPLAIN)
An execution plan is the step-by-step strategy the database's query optimizer chose to run a query — which indexes to use, which join algorithm, and in what order. You view it by prefixing a query with EXPLAIN or EXPLAIN PLAN FOR.
Reading a plan tells you whether the optimizer used an index scan (good) or a full table scan (potentially bad, on a large table), what join method it chose, and where the estimated cost is concentrated. EXPLAIN ANALYZE (PostgreSQL) or actually running the query goes further, comparing the optimizer's row-count estimates against what actually happened — a big gap between estimated and actual rows is the classic sign of stale statistics.
This is the single most useful tool for diagnosing "why is this query slow."
EXPLAIN ANALYZE
SELECT * FROM employees WHERE department_id = 60;