Use autovacuum or standard VACUUM to clean up dead row versions and make their space reusable inside PostgreSQL. Use VACUUM FULL only when you need to compact a table file and return space to the operating system—and can accommodate its exclusive lock, extra disk use, and I/O. The right choice depends on what “reclaim space” means for your workload.
What PostgreSQL table bloat means for disk space
An UPDATE or DELETE can leave old row versions that are no longer needed. Vacuuming removes reclaimable dead versions and makes their space available for reuse. That does not necessarily make the table’s relation file smaller: standard vacuum usually leaves the space in the file so PostgreSQL can use it for later rows in the same table.
As an Amazon Associate I earn from qualifying purchases.
So there are two different goals:
- Reuse capacity within the table: routine autovacuum or standard
VACUUMis normally appropriate. - Reduce the relation file and return space to the operating system: a table rewrite such as
VACUUM FULLmay be needed.
There is no universal bloat percentage or size threshold that makes a rewrite worthwhile for every workload. Consider whether the space can be reused, whether the table is likely to grow back, and the operational cost of rewriting it.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →How the three maintenance options differ
| Approach | Main effect | Does it return space to the operating system? | Concurrency and workload considerations | Best fit |
|---|---|---|---|---|
| Autovacuum | Automatically schedules routine vacuum and analyze work. | Usually not; eligible empty pages at the relation’s end may be truncated. | Runs in the background. Vacuum I/O can affect other work, and cost settings can reduce its impact. | Ongoing maintenance; tune for table size and churn where needed. |
Standard VACUUM |
Removes dead row versions and makes their space reusable. | Usually not; it may truncate completely empty pages at the end of the table. | Ordinarily permits normal reads and writes, though vacuum can generate substantial I/O. End-page truncation may require an ACCESS EXCLUSIVE lock. |
Routine cleanup or a manual catch-up when space can be reused inside the table. |
VACUUM FULL |
Rewrites the table into a compact new file. | Yes, when successful. | Slower, requires temporary room for the new copy while the old copy remains, and holds an ACCESS EXCLUSIVE lock. |
Planned, exceptional physical shrink when the returned disk space justifies the disruption. |
PostgreSQL’s VACUUM command documentation describes the command’s behavior and options. Its routine vacuuming guidance explains why standard vacuum is recurring maintenance rather than a command to minimize every table file.
#1 Best Overall
What autovacuum does—and what it does not do
Autovacuum is PostgreSQL’s background facility for scheduling VACUUM and ANALYZE. In PostgreSQL 18 it is enabled by default, but track_counts must also be enabled for the statistics autovacuum uses. It does not run VACUUM FULL; its purpose is regular maintenance, not compacting each table to its smallest possible size.
For PostgreSQL 18, documented defaults include three simultaneous autovacuum workers, a one-minute minimum delay between runs on a database, a vacuum threshold of 50 updated or deleted tuples, and a vacuum scale factor of 0.2. The trigger combines the threshold with a fraction of table size, subject to a documented maximum threshold. These are defaults, not universal tuning recommendations. Large or frequently updated tables may need table-specific threshold or scale-factor settings.
Rank #2
Autovacuum also helps protect against transaction ID wraparound. PostgreSQL can start vacuum workers for this safety purpose even if autovacuum is otherwise disabled, so disabling the daemon is not a solution to bloat. Review the version-specific vacuuming configuration documentation before changing settings.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsWhat standard VACUUM accomplishes
Standard VACUUM cleans up dead row versions in tables and indexes and marks the resulting space reusable. It ordinarily runs alongside normal reads and writes. It usually does not shrink the relation file, although PostgreSQL may truncate completely empty pages at the physical end of a table when it can acquire the needed lock. The vacuum_truncate setting or the command’s TRUNCATE option can disable that end-page truncation when avoiding its lock is more important than reclaiming those pages.
Rank #3
Vacuum is not merely a defragmentation operation. It updates the visibility map, which supports index-only scans, and freezes old rows as part of transaction ID maintenance. Planner statistics are maintained by ANALYZE, which autovacuum schedules and which can also be run separately; vacuuming and statistics collection address related but distinct maintenance needs.
Vacuum can create substantial I/O. PostgreSQL provides cost-based delay settings to reduce interference with concurrent work; choose the trade-off based on workload and service objectives rather than assuming vacuum is cost-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When VACUUM FULL is justified
Choose VACUUM FULL when reducing the physical table file is a real requirement—for example, when reclaimed disk capacity matters more than continued access to that table during the rewrite. It copies live data into a new compact file, so the old and new copies coexist until the operation finishes. Confirm that the filesystem has enough temporary headroom and schedule for an ACCESS EXCLUSIVE lock, which prevents concurrent use of the table while the command runs.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →It is usually a poor recurring strategy for a table that will quickly consume the freed space again. PostgreSQL’s routine-vacuuming guidance states: “The usual goal of routine vacuuming is to do standard VACUUMs often enough to avoid needing VACUUM FULL.”
CLUSTER and some ALTER TABLE operations also rewrite a table and its indexes. They have their own semantics, require temporary space, and take an ACCESS EXCLUSIVE lock; they are not lock-free substitutes for VACUUM FULL.
Quick Recap
A practical decision sequence
- Identify the problem. Decide whether you need dead-row cleanup, a smaller physical relation file, refreshed planner statistics, or protection from transaction ID age. Vacuum-related operations serve different parts of this list.
- If internal reuse is enough, allow autovacuum to work or run standard
VACUUMfor a manual catch-up. Do not expect ordinary vacuum to shrink the file in most cases. - If physical shrink is required, evaluate the expected benefit against temporary disk capacity, I/O, and the time the table will be unavailable under the exclusive lock before running
VACUUM FULL. - For recurring high churn, check autovacuum and
track_counts, then review table-specific thresholds and scale factors rather than repeatedly rewriting the table.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




