PostgreSQL provides MVCC (Multi Version Concurrency Control) to achieve one of the ACID properties called isolation. Transactional isolation is nothing but achieving the maximum possible concurrency among concurrent transactions. PostgreSQL has implemented MVCC to achieve this concurrency by creating versions of each tuple when the tuple receives any modifications. For example, let's say that a tuple received n concurrent modifications. PostgreSQL will keep n versions of the same tuple and it will make the last committed modified tuple as visible to further transactions. Having both visible and non-visible tuples leads to more disk space utilization. However, PostgreSQL provides a few ways to reutilize the non-visible tuples for further write operations.
In this chapter, we will be discussing what PostgreSQL offers to clean the nonvisible tuples, and how they internally work.