Module12_Routine_Maintenance Flashcards
what are the 3 maintenance commands
Analyze
vacuum
cluster
how to analyze 1 table
analyze table_name;
what does vacuum full do?
rewrite the entire table with only valid rows. whole table will be blocked and extra disk is used.
how can we prevent transaction ID wraparround failures
by performing vacuum
where are the visibility map stored
stored ar <relfilenode>_vm (visibility map)</relfilenode>
what are the 2 actions autovacuum can’t do
perform a VACUUM FULL and vacuum temporary tables
how to enable or change autovacuum for 1 table
alter table TABLE_NAME autovaccum_enabled;
how to rebuild an index
reindex index/table/schema/database NAME;
how to perform vacuum and analyze on database at once from OS
vacuumdb -az (A is for all databases and Z is for analyze)