/
Ao
/
MaxReport
Обзор
Документация
Войти
/
Ao
/
MaxReport
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
pgsql/doc/src/sgml/html/storage-hot.html
51 строка
6 KB
AoAnima
first_commit
13 июл 2026, 17:47
13 июл 2026, 17:47
f1a670a
Код
Авторство
О чём код?
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>66.7. Heap-Only Tuples (HOT)</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="storage-page-layout.html" title="66.6. Database Page Layout" /><link rel="next" href="transactions.html" title="Chapter 67. Transaction Processing" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">66.7. Heap-Only Tuples (<acronym class="acronym">HOT</acronym>)</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="storage-page-layout.html" title="66.6. Database Page Layout">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="storage.html" title="Chapter 66. Database Physical Storage">Up</a></td><th width="60%" align="center">Chapter 66. Database Physical Storage</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="transactions.html" title="Chapter 67. Transaction Processing">Next</a></td></tr></table><hr /></div><div class="sect1" id="STORAGE-HOT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">66.7. Heap-Only Tuples (<acronym class="acronym">HOT</acronym>) <a href="#STORAGE-HOT" class="id_link">#</a></h2></div></div></div><p> To allow for high concurrency, <span class="productname">PostgreSQL</span> uses <a class="link" href="mvcc-intro.html" title="13.1. Introduction">multiversion concurrency control</a> (<acronym class="acronym">MVCC</acronym>) to store rows. However, <acronym class="acronym">MVCC</acronym> has some downsides for update queries. Specifically, updates require new versions of rows to be added to tables. This can also require new index entries for each updated row, and removal of old versions of rows and their index entries can be expensive. </p><p> To help reduce the overhead of updates, <span class="productname">PostgreSQL</span> has an optimization called heap-only tuples (<acronym class="acronym">HOT</acronym>). This optimization is possible when: </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> The update does not modify any columns referenced by the table's indexes, not including summarizing indexes. The only summarizing index method in the core <span class="productname">PostgreSQL</span> distribution is <a class="link" href="brin.html" title="65.5. BRIN Indexes">BRIN</a>. </p></li><li class="listitem"><p> There is sufficient free space on the page containing the old row for the updated row. </p></li></ul></div><p> In such cases, heap-only tuples provide two optimizations: </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> New index entries are not needed to represent updated rows, however, summary indexes may still need to be updated. </p></li><li class="listitem"><p> When a row is updated multiple times, row versions other than the oldest and the newest can be completely removed during normal operation, including <code class="command">SELECT</code>s, instead of requiring periodic vacuum operations. (Indexes always refer to the <a class="link" href="storage-page-layout.html" title="66.6. Database Page Layout">page item identifier</a> of the original row version. The tuple data associated with that row version is removed, and its item identifier is converted to a redirect that points to the oldest version that may still be visible to some concurrent transaction. Intermediate row versions that are no longer visible to anyone are completely removed, and the associated page item identifiers are made available for reuse.) </p></li></ul></div><p> </p><p> You can increase the likelihood of sufficient page space for <acronym class="acronym">HOT</acronym> updates by decreasing a table's <a class="link" href="sql-createtable.html#RELOPTION-FILLFACTOR"><code class="literal">fillfactor</code></a>. If you don't, <acronym class="acronym">HOT</acronym> updates will still happen because new rows will naturally migrate to new pages and existing pages with sufficient free space for new row versions. The system view <a class="link" href="monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW" title="27.2.19. pg_stat_all_tables">pg_stat_all_tables</a> allows monitoring of the occurrence of HOT and non-HOT updates. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="storage-page-layout.html" title="66.6. Database Page Layout">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="storage.html" title="Chapter 66. Database Physical Storage">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="transactions.html" title="Chapter 67. Transaction Processing">Next</a></td></tr><tr><td width="40%" align="left" valign="top">66.6. Database Page Layout </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Chapter 67. Transaction Processing</td></tr></table></div></body></html>