The agent reads pg_stat_statements every 5 minutes and ships the top 25 statements by mean execution time. Parameterised, deduped, sortable. The signal you wanted three years ago for tuning queries.
It has the calls, the total time and the mean. Reading it beats sampling and guessing.
One 8-second outlier is a story. A 400ms query called twenty thousand times is your afternoon.
The agent polls the view every few minutes. No query rewriting, no proxy, no sampling of your traffic.
Statements arrive already parameterised, so the same query with different arguments stays one row.
Sorted by mean time rather than max, because one slow outlier matters less than a query that is always slow.
pg_stat_statements is shipped with Postgres but off by default. Enable it with shared_preload_libraries = 'pg_stat_statements' + CREATE EXTENSION pg_stat_statements. Many managed Postgres (RDS, Crunchy, Supabase) enable it for you.pg_stat_statements tells you which queries are actually hot in your workload over time. Use both.email = 'sascha@…' ever lands here — just email = $1.PG Slow-Query Monitor included from Starter. Same UI for Postgres, MySQL slow-log shares the schema.