Vacuum in postgresql
FRAGMENTATION
===================
VACUUM
garbage collect and optionally analyze a database.
vacuum reclaims storage occupied by dead tuples.
postgreSQL operation, tuples that deleted or update are not physically removed from their table.
vacuum
simply regains space and makes it available for re-use.an exclusive lock is not obtained,
extra space is not returned to the operating system.
This command can operate in parallel with normal reading and writing of the table.
vacuum full
it reclaim more space, takes much longer time and exclusively locks the table.
extra disk space, since it wites a new copy of the table and doesn't release the old copy until the operation is complete.
vacuum freeze
select aggressive freezing of tuples
vacuum_freeze_min_age=0 #equivalent the freeze is performed.
vacuum analyze
updates statistics used by the planner to determine the most efficient way to execute a query.
vacuum t1;
vacuum verbose t1 ---it will show the what's going on internaly.
vacuum analyze t1; --Analyze means it ill analyze the table and update statistics to optimizer.
select pg_size_pretty(pg_total_relation_size('TEST_5'));
./vacuumdb -t t1 -d dbname -f -F -z -Z --it is utility to vacuum in os level...
select * from pg_stat_user_tables; ---last_anayzed,dead-row,last-vacuumed to view the column'select
===================
VACUUM
garbage collect and optionally analyze a database.
vacuum reclaims storage occupied by dead tuples.
postgreSQL operation, tuples that deleted or update are not physically removed from their table.
vacuum
simply regains space and makes it available for re-use.an exclusive lock is not obtained,
extra space is not returned to the operating system.
This command can operate in parallel with normal reading and writing of the table.
vacuum full
it reclaim more space, takes much longer time and exclusively locks the table.
extra disk space, since it wites a new copy of the table and doesn't release the old copy until the operation is complete.
vacuum freeze
select aggressive freezing of tuples
vacuum_freeze_min_age=0 #equivalent the freeze is performed.
vacuum analyze
updates statistics used by the planner to determine the most efficient way to execute a query.
vacuum t1;
vacuum verbose t1 ---it will show the what's going on internaly.
vacuum analyze t1; --Analyze means it ill analyze the table and update statistics to optimizer.
select pg_size_pretty(pg_total_relation_size('TEST_5'));
./vacuumdb -t t1 -d dbname -f -F -z -Z --it is utility to vacuum in os level...
select * from pg_stat_user_tables; ---last_anayzed,dead-row,last-vacuumed to view the column'select
Comments
Post a Comment