Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created January 31, 2021 04:25
Show Gist options
  • Save StevenJL/185c362374f7d02cf3cc97749124d5be to your computer and use it in GitHub Desktop.
Save StevenJL/185c362374f7d02cf3cc97749124d5be to your computer and use it in GitHub Desktop.
Cache Hit Ratio for psql table
SELECT
(heap_blks_hit::decimal / (heap_blks_hit + heap_blks_read)) as cache_hit_ratio
FROM
pg_statio_user_tables
WHERE relname = 'large_table';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment