PostgreSQL & Databases
Vacuum and autovacuum
PostgreSQL vacuum reclaims removable row versions and supports transaction-ID safety.
What you will be able to do
- Explain the failure boundary and tradeoff
- Choose a safe first response using the available evidence
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A command to try yourself
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- MVCC visibilityBeginner · 4 min
PostgreSQL keeps several versions of a row, so readers and writers rarely block each other. You learn how a snapshot decides which version a query sees, and why old…
- Tuple versionsIntermediate · 4 min
A tuple is one stored row version, with xmin and xmax in its header. You learn why a deleted row still takes space, and why a normal vacuum rarely shrinks the file.
- Transaction ID wraparoundIntermediate · 4 min
Transaction IDs are 32 bits and wrap, so PostgreSQL freezes old rows with VACUUM. You learn how to read the age of each database and table, and what blocks freezing.
- Isolation anomaliesIntermediate · 4 min
An isolation level decides which concurrent changes a transaction can see, and which anomalies remain. You learn the four classic anomalies and how PostgreSQL's three…
- Deadlock detectionIntermediate · 4 min
A deadlock is a cycle of lock waits, and PostgreSQL aborts one transaction in the cycle after deadlock_timeout. You learn how to find the blocker, and how lock ordering…
- B tree indexesIntermediate · 4 min
A B-tree is the default index type, a sorted tree that serves equality, ranges and ordering. You learn how to test an index with EXPLAIN ANALYZE and check whether it is…