From 0e52543d887e63d63216a3804f583543e6dc26e7 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 2 Nov 2017 13:27:15 -0700 Subject: [PATCH 1/2] Add analyze when performing VACUUM FULL Prior to this commit, we only did a VACUUM FULL. However, this already requires reading the whole table so it's advantageous to also analyze the table at the same time. Otherwise autovacuum will come around and analyze the table later when it could have already been complted during the VACUUM FULL. After this commit, we add --analyze to vacuumdb. --- files/vacuum_full_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/vacuum_full_tables.sh b/files/vacuum_full_tables.sh index 624f9a6..617a5ad 100644 --- a/files/vacuum_full_tables.sh +++ b/files/vacuum_full_tables.sh @@ -30,6 +30,6 @@ SQL="SELECT t.relname::varchar AS table_name for TABLE in $(su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/psql -d pe-puppetdb -c \"$SQL\" --tuples-only") do #echo $TABLE - su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/vacuumdb -d pe-puppetdb -t $TABLE --full" + su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/vacuumdb -d pe-puppetdb -t $TABLE --full --analyze" sleep $SLEEP done From 6de56fec70c5fd0b4ad05b4b7def1e95166fd4e7 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 2 Nov 2017 13:31:45 -0700 Subject: [PATCH 2/2] Update metadata / Changelong to 0.12.1 --- CHANGELOG.md | 4 ++++ metadata.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 016baf0..fe522f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Z Release 0.12.1 + + - Add `--analyze` during VACUUM FULL commands run in maintenance [#13](https://github.com/npwalker/pe_databases/pull/13) + ## Minor Release 0.12.0 - Improve maintenance cron jobs [#12](https://github.com/npwalker/pe_databases/pull/12) diff --git a/metadata.json b/metadata.json index 4f13910..a389b7d 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "npwalker/pe_databases", - "version": "0.12.0", + "version": "0.12.1", "author": "npwalker", "summary": "A Puppet Module for Backing Up / Maintaining / Tuning Your Puppet Enterprise Databases", "license": "Apache-2.0",