Turn it on
The extension ships with PostgreSQL but needs to be preloaded:
# postgresql.conf
shared_preload_libraries = 'pg_stat_statements'
Restart the server, then run CREATE EXTENSION pg_stat_statements;. Most managed services (RDS, Cloud SQL, Supabase, Neon) have it available already.
Read it
- Total time finds what costs the server the most overall.
- Mean time finds the individually slow queries users wait on.
- Calls finds chatty code: N+1 loops and missing caching.
Copy a query into the SQL editor and press Explain to see why it is slow.
And the rest of the picture
The Performance Advisor adds cache hit ratio, unused indexes, table bloat, sequential scan hot spots and connection use.