Skip to content

Finding out last VACUUM/ANALYZE times in PostgreSQL

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.

Share/save this page:
  • email
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • del.icio.us
  • Digg
  • Reddit
  • StumbleUpon
  • Technorati
  • DZone
  • Slashdot
  • Fark
  • Facebook
  • MySpace
  • LinkedIn
  • Live
  • connotea

{ 1 } Comments

  1. David Underhill | February 18, 2011 at 2:31 am | Permalink

    Thanks Andrew – this is just what I needed!

{ 1 } Trackback

  1. [...] http://biotext.org.uk/finding-out-last-vacuumanalyze-times-in-postgresql/ [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *