pg_stat_statements — Production Query Monitoring and Slow Query Analysis
pg_stat_statements — Production Query Monitoring and Slow Query Analysis
EXPLAIN tells you about a single query in development. pg_stat_statements tells you about every query that has ever run in production, ranked by cumulative cost. It is the most important observability tool in the PostgreSQL ecosystem.