Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created January 31, 2021 04:30
Show Gist options
  • Select an option

  • Save StevenJL/488b46f813e7066193641f412e506427 to your computer and use it in GitHub Desktop.

Select an option

Save StevenJL/488b46f813e7066193641f412e506427 to your computer and use it in GitHub Desktop.
Psql Overall Cache Hit Ratio
SELECT
SUM(heap_blks_hit) / (SUM(heap_blks_hit) + SUM(heap_blks_read)) as cache_hit_ratio;
FROM
pg_statio_user_tables;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment