How to find when Postgres tables were auto-vacuumed and auto-analyzed?
This article will show you how to determine when your database tables were last vacuumed, auto-vacuumed, analyzed, and auto-analyzed on a PostgresSQL 8.x database.
- Login to the PostgresSQL command-line interface
psql -U [username] [database_name]
- Run the following query:
select relname,last_vacuum, last_autovacuum, last_analyze, last_autoanalyze from pg_stat_user_tables;