diff options
| author | David Leutgeb <david@noreply.localhost> | 2024-08-08 10:41:20 +0200 |
|---|---|---|
| committer | David Leutgeb <david@noreply.localhost> | 2024-08-08 10:41:20 +0200 |
| commit | 0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc (patch) | |
| tree | 61412230e89c86cb0f710439e0861dbccf3e793f /change_settings.md | |
| parent | 550434f33aa9ffdebe9a4e79f00738b2814cb139 (diff) | |
| download | postgresql_hacks-0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc.tar.gz postgresql_hacks-0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc.zip | |
Diffstat (limited to 'change_settings.md')
| -rw-r--r-- | change_settings.md | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/change_settings.md b/change_settings.md index aa115b7..743c0b6 100644 --- a/change_settings.md +++ b/change_settings.md @@ -30,4 +30,23 @@ select sourcefile, name,sourceline,error from pg_file_settings where error is no ``` select pg_hba_file_rules(); -```
\ No newline at end of file +``` + +## Check vacuuming and autovacuuming date for tables per database + +Switch to the desired database and then you run this query to see the vaccum status. + +``` +SELECT + schemaname, + relname, + last_vacuum, + last_autovacuum, + n_dead_tup +FROM + pg_stat_all_tables +WHERE + schemaname NOT IN ('pg_catalog', 'information_schema') +ORDER BY + n_dead_tup DESC; +``` |