Created
August 21, 2013 16:19
-
-
Save drsnyder/6296632 to your computer and use it in GitHub Desktop.
what tables are approaching the need for a freeze vacuum? below 70% should be safe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
freez::int,age(relfrozenxid) as txns, | |
ROUND(100*(age(relfrozenxid)::bigint/freez::float)) AS perc, | |
n.nspname as "schema" | |
, relname::text as "name" | |
FROM | |
pg_class c | |
LEFT JOIN pg_namespace n on n.oid = c.relnamespace | |
JOIN (SELECT setting AS freez FROM pg_settings WHERE name = 'autovacuum_freeze_max_age') AS foo | |
ON (true) WHERE relkind='r' order by perc ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment