As found by @gleu , the current implementation of last_maintenance uses pg_stat_user_tables which gets rid of pg_catalog and TOAST tables:
\sv+ pg_stat_user_tables
CREATE OR REPLACE VIEW pg_catalog.pg_stat_user_tables AS
SELECT pg_stat_all_tables.relid,
…
FROM pg_stat_all_tables
WHERE (pg_stat_all_tables.schemaname
<> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name]))
AND pg_stat_all_tables.schemaname !~ '^pg_toast'::text
So :
- This is not an issue for
last_analyze on TOAST tables, as they are never analyzed by themselves
- We may miss a failing or missing VACUUM on TOAST tables (especially now that VACUUM can explicitly exclude them).
- The VACUUM and ANALYZE on
pg_catalog tables are not monitored, although they should, as they are a bit critical.
Suggestion : base the queries on pg_stat_all_tables, exclude only information_schema. For last_analyze, exclude pg_toast_% too.
Could be made at the same time than #365
As found by @gleu , the current implementation of
last_maintenanceusespg_stat_user_tableswhich gets rid ofpg_catalogand TOAST tables:So :
last_analyzeon TOAST tables, as they are never analyzed by themselvespg_catalogtables are not monitored, although they should, as they are a bit critical.Suggestion : base the queries on
pg_stat_all_tables, exclude onlyinformation_schema. Forlast_analyze, excludepg_toast_%too.Could be made at the same time than #365