2

I am running Postgres 9.6. I have recently been reading of the importance of VACUUMing in postgres. I am looking for a SQL statement that could return a list of my tables and when was the last time they were vacuumed. Does a statement like this exist?

1 Answer 1

4

Yes, it does:

SELECT last_vacuum,
       last_autovacuum
FROM pg_stat_all_tables
WHERE schemaname = 'myschema'
  AND relname = 'mytable';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.