postgres pruning - stachulemko/doc GitHub Wiki
Page Pruning and HOT Updates
5.1 Page Pruning While a heap page is being read or updated, Postgre��� can perform some quick page cleanup, or pruning.1 It happens in the following cases: • The previous ������ operation did not find enough space to place a new tuple into the same page. This event is reflected in the page header. • The heap page contains more data than allowed by the100 fillfactor storage parameter. An ������ operation can add a new row into the page only if this page is filled for less than fillfactor percent. The rest of the space is kept for ������ operations (no such space is reserved by default). Page pruning removes the tuples that cannot be visible in any snapshot anymore (that is, that are beyond the database horizonp. �� ). It never goes beyond a single heap page, but in return it is performed very fast. Pointers to pruned tuples remain in place since they may be referenced from an index—which is already a different page. For the same reason, neither the visibility map nor the free space map is refreshed (so the recovered space is set aside for updates, not for insertions). Since a page can be pruned during reads, any ������ statement can cause page modifica- tions. This is yet another such case in addition to deferred setting of information bits.p. �� Let’s take a look at how page pruning actually works. We are going to create a two-column table and build an index on each of the columns: