PostgreSQL 18 · Performance and maintenance
See how a query runs
Run the query and show the real plan, timings and buffer use.
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM users WHERE email = '[email protected]';
Caution: EXPLAIN ANALYZE really executes the statement. Wrap INSERT, UPDATE or DELETE in a transaction you roll back.
Official PostgreSQL 18 documentation
More performance and maintenance commands
- Create an index
- Create an index without blocking writes
- Vacuum and update statistics
- See running queries
- Cancel a running query
All performance and maintenance commands · PostgreSQL 18 cheatsheet