Skip to content

Instantly share code, notes, and snippets.

@leafo
Last active August 29, 2015 13:59
Show Gist options
  • Save leafo/10523944 to your computer and use it in GitHub Desktop.
Save leafo/10523944 to your computer and use it in GitHub Desktop.
-- vacuum and analyze stats
SELECT relname, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze FROM pg_stat_user_tables;
-- scan vs index rate
select relname, seq_scan, idx_scan, round(seq_scan::numeric/(seq_scan + idx_scan),4) ratio
from pg_stat_user_tables order by ratio desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment