summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--change_settings.md21
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;
+```