psql -U alice -d mydb -c 'EXPLAIN ANALYZE SELECT * FROM users WHERE id=1;'
Show a query plan with real execution timings
EXPLAIN ANALYZE actually runs the query and reports each plan step with actual times and row counts, revealing where the work happens. Add (ANALYZE, BUFFERS) for disk cache stats. Related: \timing for the whole-query duration.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.