When was my database last vacuumed or analyzed? This took me a while to figure out from googling around so I’ll put it here for posterity, short and sweet.
select relname, last_vacuum, last_analyze from pg_stat_all_tables where schemaname = 'public'
Add the columns last_autovacuum or last_autoanalyze if you use those features.
Andrew.
{ 1 } Comments
Thanks Andrew – this is just what I needed!
{ 1 } Trackback
[...] http://biotext.org.uk/finding-out-last-vacuumanalyze-times-in-postgresql/ [...]
Post a Comment