Skip to content

Instantly share code, notes, and snippets.

@olegbuevich
Created September 30, 2016 09:23
Show Gist options
  • Save olegbuevich/ad6c98472c9a55aae59f06e65330cc2a to your computer and use it in GitHub Desktop.
Save olegbuevich/ad6c98472c9a55aae59f06e65330cc2a to your computer and use it in GitHub Desktop.
Postgresql pg_stat_statements
SELECT query, calls, total_time, rows, 100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment