バージョンごとのドキュメント一覧

73.7. ヒープ専用タプル(HOT) #

<title>Heap-Only Tuples (<acronym>HOT</acronym>)</title>

To allow for high concurrency, <productname>PostgreSQL</productname> uses <link linkend="mvcc-intro">multiversion concurrency control</link> (<acronym>MVCC</acronym>) to store rows. However, <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. 高い同時実行性を可能にするために、PostgreSQLマルチバージョン同時実行制御(MVCC)を使用して行を格納します。 しかし、MVCCには更新クエリに対していくつかの欠点があります。 特に、更新では、テーブルに新しいバージョンの行を追加する必要があります。 また、更新された行ごとに新しいインデックスエントリが必要になる可能性があり、古いバージョンの行とそのインデックスエントリを削除するとコストが高くなります。

To help reduce the overhead of updates, <productname>PostgreSQL</productname> has an optimization called heap-only tuples (<acronym>HOT</acronym>). This optimization is possible when: 更新のオーバーヘッドを減らすために、PostgreSQLにはヒープ専用タプルHOTと呼ばれる最適化があります。 この最適化は以下の場合に可能です。

In such cases, heap-only tuples provide two optimizations: そのような場合に、ヒープ専用タプルは2つの最適化を提供します。

In summary, heap-only tuple updates can only be created if columns used by indexes are not updated. You can increase the likelihood of sufficient page space for <acronym>HOT</acronym> updates by decreasing a table's <link linkend="reloption-fillfactor"><literal>fillfactor</literal></link>. If you don't, <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 <link linkend="monitoring-pg-stat-all-tables-view">pg_stat_all_tables</link> allows monitoring of the occurrence of HOT and non-HOT updates. 要約すると、ヒープ専用タプル更新は、インデックスで使用されるカラムが更新されない場合にのみ作成できます。 テーブルのfillfactorを減らすことで、HOT更新のための十分なページ領域の可能性を高めることができます。 そうしない場合でも、HOT更新は発生します。 なぜなら、新しい行は新しいページや、新しい行バージョンのために十分な空き領域を持つ既存のページに自然に移動するからです。 システムビューpg_stat_all_tablesは、HOTおよび非HOT更新の発生を監視することができます。