psql -d appdb -c "EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM orders WHERE user_id = 7;"

Category: Databases & SQL

psql -d appdb -c "EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM orders WHERE user_id = 7;"

Execute a query and show real costs

Runs the query and reports actual timings plus buffer reads, revealing whether data came from cache or disk; BUFFERS adds the shared-hit and shared-read counts. The standard diagnostic for slow queries.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.