An INSERT, UPDATE, or DELETE might look like a small operation when looking at it from the outside. You add a row, change some values, or remove something that is no longer needed. But inside the database, such a request can involve memory, transaction logs, indexes, older row versions, and background cleanup. Also, other machines might be involved.
It’s the responsibility of the database to make these pieces work together while letting you run concurrent queries and dealing with crashes. This is why a committed row can still be waiting for its data page to reach disk, and a deleted row might continue to take up storage space.
In this article, we’ll look at the life of a row in the database with respect to these operations. Here’s what we’ll cover:
What is a row
How insert operations work
The role of WAL
How update operations work
How delete operations work
Vacuum and compaction
How replication and backup work
How database commits generate work



