Examples
In the examples below, [tablename] is optional. Without a table specified, VACUUM will be run on available tables in the current schema that the user has access to.
- Plain VACUUM: Frees up space for re-use
VACUUM [tablename]
- Full VACUUM: Locks the database table, and reclaims more space than a plain VACUUM
/* Before Postgres 9.0: */ VACUUM FULL /* Postgres 9.0+: */ VACUUM(FULL) [tablename]
- Full VACUUM and ANALYZE: Performs a Full VACUUM and gathers new statistics on query executions paths using ANALYZE
/* Before Postgres 9.0: */ VACUUM FULL ANALYZE [tablename] /* Postgres 9.0+: */ VACUUM(FULL, ANALYZE) [tablename]
- Verbose Full VACUUM and ANALYZE: Same as #3, but with verbose progress output
/* Before Postgres 9.0: */ VACUUM FULL VERBOSE ANALYZE [tablename] /* Postgres 9.0+: */ VACUUM(FULL, ANALYZE, VERBOSE) [tablename]Читать далее «Обслуживание PostgreSql»