Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Rajaneeshs/ffc4d9bc25fcbdd323785331ac5172d6 to your computer and use it in GitHub Desktop.
Save Rajaneeshs/ffc4d9bc25fcbdd323785331ac5172d6 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