Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index …
The REINDEX command rebuilds one or more indices, replacing the previous version of the index. REINDEX can be used in many scenarios, including the following (from Postgres documentation): An index has become corrupted, and no longer contains valid data. Although in theory …
1.Script for vacuum, analyze and Reindexing the database cat /home/script/vaccum_analyze_reindex.sh #!/bin/bash PGHOME=/opt/PostgreSQL/9.3/bin LOG=/backups/logs/igr-vac-logs LOGFILE=vacuum_analyze_`date +”%Y-%m-%d-%T”`.log REINDEXLOG=reindex_`date +”%Y-%m-%d-%T”`.log export PGOPTIONS=’-c vacuum_cost_delay=10 -c maintenance_work_mem=5GB’ export PGPASSWORD=postgres $PGHOME/vacuumdb -d db_name -j 5 -p 5432 -z >> $LOG/$LOGFILE 2>> $LOG/$LOGFILE $PGHOME/reindexdb -d db_name -p …