🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Advanced

What is Vacuum?

A PostgreSQL maintenance operation that reclaims storage from dead tuples and updates statistics for the query planner.

PostgreSQL's MVCC creates dead tuples when rows are updated or deleted. VACUUM marks this space for reuse (but does not return it to the OS). VACUUM FULL rewrites the entire table, recovering disk space but requiring an exclusive lock.

Autovacuum runs automatically based on configurable thresholds. ANALYZE updates statistics used by the query planner. Proper vacuum configuration is critical for maintaining database performance and preventing table bloat.

Related Terms

ORM (Object-Relational Mapping)
A technique that lets you interact with a database using object-oriented code instead of writing raw SQL queries.
Deadlock
A situation where two or more transactions permanently block each other by each holding locks that the other needs.
Time-Series Database
A database optimized for storing and querying timestamped data points like metrics, sensor readings, and event logs.
B-Tree Index
The default index type in most databases that organizes data in a balanced tree structure for efficient searching, sorting, and range queries.
Full-Text Search
A technique for searching natural language text in databases using word stemming, ranking, and relevance scoring.
Database Backup
The process of creating copies of database data to protect against data loss from failures, corruption, or human error.
View All Databases Terms →