SELECT queryid, calls,
trunc(total_time::numeric, 2) as total_time,
trunc(mean_time::numeric, 2) as mean_time,
rows
FROM pg_stat_statements
ORDER BY total_time DESC
LIMIT 10;
select queryid, calls, total_time, min_time, max_time, mean_time, rows/calls as rows,
pg_size_pretty(shared_blks_hit*1024*8) as shared_blks_hit_size,
pg_size_pretty(shared_blks_hit*1024*8/calls) as mean_shared_bkls_hit_size
from pg_stat_statements order by total_time desc limit 10;