Postgres: Find Slow Queries
SQLTop queries by total time (needs pg_stat_statements).
SQL · 7 lines
copied 20 times
SELECT round(total_exec_time::numeric, 1) AS total_ms,
calls,
round(mean_exec_time::numeric, 2) AS mean_ms,
left(query, 120) AS query
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;
1
Fire
1
Learned something
2
Saved me time
0
Mind-blown
Sign in to react and star