autovacuum monitoring

As log files can easily get lost, the best way to approach making sure autovacuum is doing what it should is to monitor what tables it's worked on instead:

SELECT schemaname,relname,last_autovacuum,last_autoanalyze FROM pg_stat_all_tables; 

You can trim down the information here by changing all in the preceding code to name one of the alternate views: pg_stat_sys_tables shows only system tables, while pg_stat_user_tables shows only your user tables.

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.