-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
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'::textSo :
- This is not an issue for
last_analyzeon 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_catalogtables 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