Simple PostgreSQL vacuum script
In this tutorial i will explained about how to find out vacuum size of database level and how to write script for vacuum and analyze in postgreSQL open source database. Ans: 1.Find out the vacuum level \c chennai select count(*) from pg_stat_all_tables where n_dead_tup > 1000; \c mumbai select count(*) from pg_stat_all_tables where n_dead_tup > 1000; \c kolkatta select count(*) from pg_stat_all_tables where n_dead_tup > 1000; \c banglore select count(*) from pg_stat_all_tables where n_dead_tup > 1000; \c newyork select count(*) from pg_stat_all_tables where n_dead_tup > 1000; select schemaname,relname,n_dead_tup,last_vacuum,last_autovacuum, last_analyze, last_autoanalyze from pg_stat_all_tables; 2.Script for Analyze and vacuum the postgresql dead tubles vi /home/script/vaccum_database.sh #!/bin/sh # The script sets environment variables helpful for PostgreSQL export PATH=/opt/PostgreSQL/9.6/bin:$PATH export PGDATA=/data/emut_96/ export PGDATABASE=post...