
ByteByteGo · 1 min readDatabases
The Life of a Database Row: What Really Happens Behind the Scenes
The article explains how INSERT, UPDATE, and DELETE operations affect a database row, covering transaction logs, WAL, indexing, and background tasks. It shows why a committed row may still be pending disk write and how deleted rows can linger until vacuuming. Understanding these steps helps developers debug performance and storage issues.
- INSERT writes to WAL, updates in-memory buffer, then flushes to disk asynchronously.
- UPDATE creates a new row version and marks the old one for later cleanup.
- VACUUM removes dead row versions and reclaims space, essential for long-running workloads.