6
HOT Update
Values of the indexed columns must not change
otherwise you will have to add an index entry referencing the new row
version, and the version cannot be tagged as heap only
Update chain must remain within one page
no need to access other pages,
traversing the chain does not degrade performance
if the table page does not have enough space for the new version,
the chain is broken (as if the optimization does not work)
space on the page can be reserved by reducing
the fillfactor storage parameter of the table (100% → 10%)
We emphasize that HOT updates work only if none of the values of the
indexed columns are changed. Otherwise, a reference appears in an index
directly to the new row version, which contradicts the idea of this
optimization. Only the abovementioned BRIN index does not prevent HOT
updates (it does not contain references to individual table rows).
HOT updates are also applied to tables that have no indexes at all. When
any field in such a table is updated, a version chain is built.
This optimization is confined to one page. Therefore, traversing the chain
does not require accessing other pages and does not degrade performance.
However, if the page does not have enough free space to place a new row
version, the chain is broken. You have to make a reference from the index to
the row version located on a different page.
Therefore, with frequent updates of non-indexed fields, it may be beneficial
to reduce the fillfactor storage parameter. This parameter specifies the
threshold percentage of space occupied on the page after which new rows
cannot be inserted. The default value is 100%, it can be reduced to up to
10%. The remaining space is reserved for updates. In this case, a new row
version can fit on the same page. (On the other hand, the higher the
fillfactor, the more compact the records are and, accordingly, the table size is
smaller.)