summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leutgeb <david@noreply.localhost>2024-08-08 10:41:20 +0200
committerDavid Leutgeb <david@noreply.localhost>2024-08-08 10:41:20 +0200
commit0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc (patch)
tree61412230e89c86cb0f710439e0861dbccf3e793f
parent550434f33aa9ffdebe9a4e79f00738b2814cb139 (diff)
downloadpostgresql_hacks-0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc.tar.gz
postgresql_hacks-0f356a9b79d769f2d39a0c491f1901d2e4ad1ddc.zip
Update change_settings.mdHEADmaster
-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;
+```