diff options
Diffstat (limited to 'doc/src/sgml/ref/create_table.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_table.sgml | 104 |
1 files changed, 55 insertions, 49 deletions
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index a2d0b0cbe1e..f0c94d591ef 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -878,14 +878,14 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI Storage parameters for indexes are documented in <xref linkend="SQL-CREATEINDEX">. The storage parameters currently - available for tables are listed below. For each parameter, unless noted, - there is an additional parameter with the same name prefixed with - <literal>toast.</literal>, which can be used to control the behavior of the + available for tables are listed below. For many of these parameters, as + shown, there is an additional parameter with the same name prefixed with + <literal>toast.</literal>, which controls the behavior of the table's secondary <acronym>TOAST</> table, if any (see <xref linkend="storage-toast"> for more information about TOAST). - Note that the TOAST table uses the parameter values defined for - the main table, for each parameter applicable to TOAST tables and - for which no value is set in the TOAST table itself. + If a table parameter value is set and the + equivalent <literal>toast.</literal> parameter is not, the TOAST table + will use the table's parameter value. </para> <variablelist> @@ -912,22 +912,19 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_enabled</>, <literal>toast.autovacuum_enabled</literal> (<type>boolean</>)</term> <listitem> <para> - Enables or disables the autovacuum daemon on a particular table. - If true, the autovacuum daemon will initiate a <command>VACUUM</> operation - on a particular table when the number of updated or deleted tuples exceeds - <literal>autovacuum_vacuum_threshold</> plus - <literal>autovacuum_vacuum_scale_factor</> times the number of live tuples - currently estimated to be in the relation. - Similarly, it will initiate an <command>ANALYZE</> operation when the - number of inserted, updated or deleted tuples exceeds - <literal>autovacuum_analyze_threshold</> plus - <literal>autovacuum_analyze_scale_factor</> times the number of live tuples - currently estimated to be in the relation. + Enables or disables the autovacuum daemon for a particular table. + If true, the autovacuum daemon will perform automatic <command>VACUUM</> + and/or <command>ANALYZE</> operations on this table following the rules + discussed in <xref linkend="autovacuum">. If false, this table will not be autovacuumed, except to prevent - transaction Id wraparound. See <xref linkend="vacuum-for-wraparound"> for + transaction ID wraparound. See <xref linkend="vacuum-for-wraparound"> for more about wraparound prevention. - Observe that this variable inherits its value from the <xref - linkend="guc-autovacuum"> setting. + Note that the autovacuum daemon does not run at all (except to prevent + transaction ID wraparound) if the <xref linkend="guc-autovacuum"> + parameter is false; setting individual tables' storage parameters does + not override that. Therefore there is seldom much point in explicitly + setting this storage parameter to <literal>true</>, only + to <literal>false</>. </para> </listitem> </varlistentry> @@ -936,8 +933,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_vacuum_threshold</>, <literal>toast.autovacuum_vacuum_threshold</literal> (<type>integer</>)</term> <listitem> <para> - Minimum number of updated or deleted tuples before initiate a - <command>VACUUM</> operation on a particular table. + Per-table value for <xref linkend="guc-autovacuum-vacuum-threshold"> + parameter. </para> </listitem> </varlistentry> @@ -946,8 +943,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_vacuum_scale_factor</>, <literal>toast.autovacuum_vacuum_scale_factor</literal> (<type>float4</>)</term> <listitem> <para> - Multiplier for <structfield>reltuples</> to add to - <literal>autovacuum_vacuum_threshold</>. + Per-table value for <xref linkend="guc-autovacuum-vacuum-scale-factor"> + parameter. </para> </listitem> </varlistentry> @@ -956,8 +953,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_analyze_threshold</> (<type>integer</>)</term> <listitem> <para> - Minimum number of inserted, updated, or deleted tuples before initiate an - <command>ANALYZE</> operation on a particular table. + Per-table value for <xref linkend="guc-autovacuum-analyze-threshold"> + parameter. </para> </listitem> </varlistentry> @@ -966,8 +963,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_analyze_scale_factor</> (<type>float4</>)</term> <listitem> <para> - Multiplier for <structfield>reltuples</> to add to - <literal>autovacuum_analyze_threshold</>. + Per-table value for <xref linkend="guc-autovacuum-analyze-scale-factor"> + parameter. </para> </listitem> </varlistentry> @@ -976,7 +973,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_vacuum_cost_delay</>, <literal>toast.autovacuum_vacuum_cost_delay</literal> (<type>integer</>)</term> <listitem> <para> - Custom <xref linkend="guc-autovacuum-vacuum-cost-delay"> parameter. + Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-delay"> + parameter. </para> </listitem> </varlistentry> @@ -985,7 +983,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_vacuum_cost_limit</>, <literal>toast.autovacuum_vacuum_cost_limit</literal> (<type>integer</>)</term> <listitem> <para> - Custom <xref linkend="guc-autovacuum-vacuum-cost-limit"> parameter. + Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-limit"> + parameter. </para> </listitem> </varlistentry> @@ -994,10 +993,11 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_freeze_min_age</>, <literal>toast.autovacuum_freeze_min_age</literal> (<type>integer</>)</term> <listitem> <para> - Custom <xref linkend="guc-vacuum-freeze-min-age"> parameter. Note that - autovacuum will ignore attempts to set a per-table - <literal>autovacuum_freeze_min_age</> larger than half the system-wide - <xref linkend="guc-autovacuum-freeze-max-age"> setting. + Per-table value for <xref linkend="guc-vacuum-freeze-min-age"> + parameter. Note that autovacuum will ignore + per-table <literal>autovacuum_freeze_min_age</> parameters that are + larger than half the + system-wide <xref linkend="guc-autovacuum-freeze-max-age"> setting. </para> </listitem> </varlistentry> @@ -1006,10 +1006,10 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_freeze_max_age</>, <literal>toast.autovacuum_freeze_max_age</literal> (<type>integer</>)</term> <listitem> <para> - Custom <xref linkend="guc-autovacuum-freeze-max-age"> parameter. Note that - autovacuum will ignore attempts to set a per-table - <literal>autovacuum_freeze_max_age</> larger than the system-wide setting - (it can only be set smaller). + Per-table value for <xref linkend="guc-autovacuum-freeze-max-age"> + parameter. Note that autovacuum will ignore + per-table <literal>autovacuum_freeze_max_age</> parameters that are + larger than the system-wide setting (it can only be set smaller). </para> </listitem> </varlistentry> @@ -1018,7 +1018,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_freeze_table_age</literal>, <literal>toast.autovacuum_freeze_table_age</literal> (<type>integer</type>)</term> <listitem> <para> - Custom <xref linkend="guc-vacuum-freeze-table-age"> parameter. + Per-table value for <xref linkend="guc-vacuum-freeze-table-age"> + parameter. </para> </listitem> </varlistentry> @@ -1027,9 +1028,10 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_multixact_freeze_min_age</literal>, <literal>toast.autovacuum_multixact_freeze_min_age</literal> (<type>integer</type>)</term> <listitem> <para> - Custom <xref linkend="guc-vacuum-multixact-freeze-min-age"> parameter. - Note that autovacuum will ignore attempts to set a per-table - <literal>autovacuum_multixact_freeze_min_age</> larger than half the + Per-table value for <xref linkend="guc-vacuum-multixact-freeze-min-age"> + parameter. Note that autovacuum will ignore + per-table <literal>autovacuum_multixact_freeze_min_age</> parameters + that are larger than half the system-wide <xref linkend="guc-autovacuum-multixact-freeze-max-age"> setting. </para> @@ -1040,10 +1042,12 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_multixact_freeze_max_age</literal>, <literal>toast.autovacuum_multixact_freeze_max_age</literal> (<type>integer</type>)</term> <listitem> <para> - Custom <xref linkend="guc-autovacuum-multixact-freeze-max-age"> parameter. Note - that autovacuum will ignore attempts to set a per-table - <literal>autovacuum_multixact_freeze_max_age</> larger than the - system-wide setting (it can only be set smaller). + Per-table value + for <xref linkend="guc-autovacuum-multixact-freeze-max-age"> parameter. + Note that autovacuum will ignore + per-table <literal>autovacuum_multixact_freeze_max_age</> parameters + that are larger than the system-wide setting (it can only be set + smaller). </para> </listitem> </varlistentry> @@ -1052,7 +1056,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>autovacuum_multixact_freeze_table_age</literal>, <literal>toast.autovacuum_multixact_freeze_table_age</literal> (<type>integer</type>)</term> <listitem> <para> - Custom <xref linkend="guc-vacuum-multixact-freeze-table-age"> parameter. + Per-table value + for <xref linkend="guc-vacuum-multixact-freeze-table-age"> parameter. </para> </listitem> </varlistentry> @@ -1061,7 +1066,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>log_autovacuum_min_duration</literal>, <literal>toast.log_autovacuum_min_duration</literal> (<type>integer</type>)</term> <listitem> <para> - Custom <xref linkend="guc-log-autovacuum-min-duration"> parameter. + Per-table value for <xref linkend="guc-log-autovacuum-min-duration"> + parameter. </para> </listitem> </varlistentry> @@ -1070,7 +1076,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI <term><literal>user_catalog_table</literal> (<type>boolean</type>)</term> <listitem> <para> - Declare a table as an additional catalog table, e.g. for the purpose of + Declare the table as an additional catalog table for purposes of logical replication. See <xref linkend="logicaldecoding-capabilities"> for details. This parameter cannot be set for TOAST tables. |