Skip to content

Last vacuum of TOAST tables & Last vacuum/analyze of pg_catalog tables #367

@Krysztophe

Description

@Krysztophe

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions