Skip to content

Instantly share code, notes, and snippets.

@arsham
Last active June 5, 2016 09:44
Show Gist options
  • Select an option

  • Save arsham/3b43f334b2b7bf4fd005 to your computer and use it in GitHub Desktop.

Select an option

Save arsham/3b43f334b2b7bf4fd005 to your computer and use it in GitHub Desktop.
Get IO stats for a particular table
select relname as "table",
heap_blks_read as "heap from disc",
heap_blks_hit as "heap from cache",
idx_blks_read as "index from disc",
idx_blks_hit as "index from cache",
toast_blks_read as "toast from disc",
toast_blks_hit as "toast from cache",
tidx_blks_read as "toast index disc",
tidx_blks_hit as "toast index cache"
from pg_statio_user_tables
where relname = 'TABLE_NAME';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment