Source: Hans-Jürgen Schönig - PostgreSQL performance in 5 minutes https://youtu.be/5M2FFbVeLSs?t=757
SELECT substring(query, 1, 5000) AS short_query,
round(total_time::numeric, 2) AS total_time,
calls, round(mean_time::numeric, 2) AS mean,
round((100*total_time/sum(total_time::numeric) OVER ())::numeric, 2) AS percentage_overall
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 20;