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

20.10. 自動Vacuum作業 #

<title>Automatic Vacuuming</title>

These settings control the behavior of the <firstterm>autovacuum</firstterm> feature. Refer to <xref linkend="autovacuum"/> for more information. Note that many of these settings can be overridden on a per-table basis; see <xref linkend="sql-createtable-storage-parameters"/>. 以下に示す設定は自動バキューム機能の動作を制御します。 詳細は25.1.6を参照してください。 これらの設定の多くは、テーブル単位で変更できることに注意してください。 格納パラメータを参照してください。

autovacuum (boolean) #

Controls whether the server should run the autovacuum launcher daemon. This is on by default; however, <xref linkend="guc-track-counts"/> must also be enabled for autovacuum to work. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; however, autovacuuming can be disabled for individual tables by changing table storage parameters. サーバがautovacuumランチャデーモンを実行すべきかどうかを管理します。 デフォルトでは有効です。 しかしautovacuumを作動させるためにはtrack_countsも有効でなければなりません。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。 ただし、テーブルストレージパラメータを変更することにより、autovacuumは個々のテーブルに対して無効にできます。

Note that even when this parameter is disabled, the system will launch autovacuum processes if necessary to prevent transaction ID wraparound. See <xref linkend="vacuum-for-wraparound"/> for more information. このパラメータが無効であったとしてもシステムは、トランザクションIDの周回を防止する必要があれば、autovacuumプロセスを起動することに注意してください。 詳細は25.1.5を参照してください。

autovacuum_max_workers (integer) #

Specifies the maximum number of autovacuum processes (other than the autovacuum launcher) that may be running at any one time. The default is three. This parameter can only be set at server start. 同時に実行することができるautovacuumプロセス(autovacuumランチャ以外)の最大数を指定します。 デフォルトは3です。 サーバ起動時のみで設定可能です。

autovacuum_naptime (integer) #

Specifies the minimum delay between autovacuum runs on any given database. In each round the daemon examines the database and issues <command>VACUUM</command> and <command>ANALYZE</command> commands as needed for tables in that database. If this value is specified without units, it is taken as seconds. The default is one minute (<literal>1min</literal>). This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line. あるデータベースについて実行されるautovacuumデーモンの最小遅延を指定します。 それぞれの周期で、デーモンはそのデータベースを試験し、そしてそのデータベース内のテーブルで必要性が認められると、VACUUMおよびANALYZEコマンドを発行します。 この値が単位なしで指定された場合は、秒単位であるとみなします。 デフォルトは1分(1min)です。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。

autovacuum_vacuum_threshold (integer) #

Specifies the minimum number of updated or deleted tuples needed to trigger a <command>VACUUM</command> in any one table. The default is 50 tuples. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. どのテーブルに対してもVACUUMを起動するために必要な、更新もしくは削除されたタプルの最小数を指定します。 デフォルトは50タプルです。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。 ただし、この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_vacuum_insert_threshold (integer) #

Specifies the number of inserted tuples needed to trigger a <command>VACUUM</command> in any one table. The default is 1000 tuples. If -1 is specified, autovacuum will not trigger a <command>VACUUM</command> operation on any tables based on the number of inserts. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. あるテーブルでVACUUMを起動するきっかけとなるのに必要な挿入タプル数を設定します。 デフォルトは1000タプルです。 -1が指定されると、自動VACUUMが挿入タプル数に基づいてVACUUM操作を引き起こすことはなくなります。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。 ただし、この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_analyze_threshold (integer) #

Specifies the minimum number of inserted, updated or deleted tuples needed to trigger an <command>ANALYZE</command> in any one table. The default is 50 tuples. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. どのテーブルに対してもANALYZEを起動するのに必要な、挿入、更新、もしくは削除されたタプルの最小数を指定します。 デフォルトは50タプルです。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。 この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_vacuum_scale_factor (floating point) #

Specifies a fraction of the table size to add to <varname>autovacuum_vacuum_threshold</varname> when deciding whether to trigger a <command>VACUUM</command>. The default is 0.2 (20% of table size). This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. VACUUMを起動するか否かを決定するときに、autovacuum_vacuum_thresholdに足し算するテーブル容量の割合を指定します。 デフォルトは0.2(テーブルサイズの20%)です。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されますが、テーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_vacuum_insert_scale_factor (floating point) #

Specifies a fraction of the table size to add to <varname>autovacuum_vacuum_insert_threshold</varname> when deciding whether to trigger a <command>VACUUM</command>. The default is 0.2 (20% of table size). This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. VACUUMを起動するかどうか決める際のautovacuum_vacuum_insert_thresholdに追加するテーブルサイズの割合を指定します。 デフォルトは0.2(テーブルサイズの20%)です。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されますが、テーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_analyze_scale_factor (floating point) #

Specifies a fraction of the table size to add to <varname>autovacuum_analyze_threshold</varname> when deciding whether to trigger an <command>ANALYZE</command>. The default is 0.1 (10% of table size). This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. ANALYZEを起動するか否かを決定するときに、autovacuum_analyze_thresholdに足し算するテーブル容量の割合を指定します。 デフォルトは0.1(テーブルサイズの10%)です。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインでのみで設定されます。 この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きされます。

autovacuum_freeze_max_age (integer) #

Specifies the maximum age (in transactions) that a table's <structname>pg_class</structname>.<structfield>relfrozenxid</structfield> field can attain before a <command>VACUUM</command> operation is forced to prevent transaction ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. トランザクションID周回を防ぐためにVACUUM操作が強制される前までにテーブルのpg_class.relfrozenxid フィールドが到達できる最大(トランザクションにおける)年代を指定します。 自動バキュームが無効であった時でも、システムは周回を防ぐために自動バキューム子プロセスを起動することに注意してください。

Vacuum also allows removal of old files from the <filename>pg_xact</filename> subdirectory, which is why the default is a relatively low 200 million transactions. This parameter can only be set at server start, but the setting can be reduced for individual tables by changing table storage parameters. For more information see <xref linkend="vacuum-for-wraparound"/>. vacuumは同時にpg_xactサブディレクトリから古いファイルの削除を許可します。 これが、比較的低い2億トランザクションがデフォルトである理由です。 このパラメータはサーバ起動時にのみ設定可能です。 しかし、この設定はテーブルストレージパラメータの変更により、それぞれのテーブルで減らすことができます。 詳細は25.1.5を参照してください。

autovacuum_multixact_freeze_max_age (integer) #

Specifies the maximum age (in multixacts) that a table's <structname>pg_class</structname>.<structfield>relminmxid</structfield> field can attain before a <command>VACUUM</command> operation is forced to prevent multixact ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. トランザクションID周回を防ぐためにVACUUM操作が強制される前までにテーブルのpg_class.relminmxid フィールドが到達できる最大(マルチトランザクションにおける)年代を指定します。 自動バキュームが無効であった時でも、システムは周回を防ぐために自動バキューム子プロセスを起動することに注意してください。

Vacuuming multixacts also allows removal of old files from the <filename>pg_multixact/members</filename> and <filename>pg_multixact/offsets</filename> subdirectories, which is why the default is a relatively low 400 million multixacts. This parameter can only be set at server start, but the setting can be reduced for individual tables by changing table storage parameters. For more information see <xref linkend="vacuum-for-multixact-wraparound"/>. またマルチトランザクションIDのvacuumはpg_multixactpg_multixact/offsetsサブディレクトリから古いファイルの削除します。 これがデフォルトが4億トランザクションをやや下回る理由です。 このパラメータはサーバ起動時にのみ設定可能です。 しかし、この設定はテーブルストレージパラメータの変更により、それぞれのテーブルで減らすことができます。 詳細は25.1.5.1を参照してください。

autovacuum_vacuum_cost_delay (floating point) #

Specifies the cost delay value that will be used in automatic <command>VACUUM</command> operations. If -1 is specified, the regular <xref linkend="guc-vacuum-cost-delay"/> value will be used. If this value is specified without units, it is taken as milliseconds. The default value is 2 milliseconds. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. 自動VACUUM操作に使用されるコスト遅延値を指定します。 -1に指定されると、一定の vacuum_cost_delayの値が使用されます。 この値が単位なしで指定された場合は、ミリ秒単位であるとみなします。 デフォルト値は2ミリ秒です。 このパラメータはpostgresql.confファイル内、またはサーバのコマンドラインのみで設定可能です。 この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。

autovacuum_vacuum_cost_limit (integer) #

Specifies the cost limit value that will be used in automatic <command>VACUUM</command> operations. If -1 is specified (which is the default), the regular <xref linkend="guc-vacuum-cost-limit"/> value will be used. Note that the value is distributed proportionally among the running autovacuum workers, if there is more than one, so that the sum of the limits for each worker does not exceed the value of this variable. This parameter can only be set in the <filename>postgresql.conf</filename> file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. 自動VACUUM操作に使用されるコスト限界値を指定します。 (デフォルトの)-1が指定されると、一定の vacuum_cost_limitの値が使用されます。 この値は、実行中の自動バキュームワーカーが複数存在する場合ワーカーすべてに比例分配されることに注意してください。 したがって各ワーカーの制限を足し合わせてもこの変数による制限を超えることはありません。 このパラメータはpostgresql.confファイル、または、サーバのコマンドラインのみで設定可能です。 この設定はテーブルストレージパラメータの変更により、それぞれのテーブルに対して上書きすることができます。