Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Krysztophe opened this issue Nov 30, 2023 · 1 comment
Open
Assignees

Comments

@Krysztophe
Copy link
Collaborator

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

@Krysztophe
Copy link
Collaborator Author

@gleu approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants