diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-03-17 12:22:05 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-03-17 12:26:26 +0100 |
commit | 012460ee93c304fbc7220e5b55d9d0577fc766ab (patch) | |
tree | af8936fda212e29d7678141691e2ad7e4b3ccd69 /doc/src | |
parent | 33e729c5148c3a697abc552621b34bdc5fd497ed (diff) | |
download | postgresql-012460ee93c304fbc7220e5b55d9d0577fc766ab.tar.gz postgresql-012460ee93c304fbc7220e5b55d9d0577fc766ab.zip |
Make stxstattarget nullable
To match attstattarget change (commit 4f622503d6d). The logic inside
CreateStatistics() is clarified a bit compared to that previous patch,
and so here we also update ATExecSetStatistics() to match.
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/4da8d211-d54d-44b9-9847-f2a9f1184c76@eisentraut.org
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 28 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_statistics.sgml | 11 |
2 files changed, 20 insertions, 19 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 387a14b1869..2f091ad09d1 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -7659,6 +7659,19 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l <row> <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>stxkeys</structfield> <type>int2vector</type> + (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>) + </para> + <para> + An array of attribute numbers, indicating which table columns are + covered by this statistics object; + for example a value of <literal>1 3</literal> would + mean that the first and the third table columns are covered + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> <structfield>stxstattarget</structfield> <type>int2</type> </para> <para> @@ -7666,7 +7679,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l of statistics accumulated for this statistics object by <link linkend="sql-analyze"><command>ANALYZE</command></link>. A zero value indicates that no statistics should be collected. - A negative value says to use the maximum of the statistics targets of + A null value says to use the maximum of the statistics targets of the referenced columns, if set, or the system default statistics target. Positive values of <structfield>stxstattarget</structfield> determine the target number of <quote>most common values</quote> @@ -7676,19 +7689,6 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l <row> <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>stxkeys</structfield> <type>int2vector</type> - (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>) - </para> - <para> - An array of attribute numbers, indicating which table columns are - covered by this statistics object; - for example a value of <literal>1 3</literal> would - mean that the first and the third table columns are covered - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> <structfield>stxkind</structfield> <type>char[]</type> </para> <para> diff --git a/doc/src/sgml/ref/alter_statistics.sgml b/doc/src/sgml/ref/alter_statistics.sgml index 73cc9e830de..c82a728a910 100644 --- a/doc/src/sgml/ref/alter_statistics.sgml +++ b/doc/src/sgml/ref/alter_statistics.sgml @@ -26,7 +26,7 @@ PostgreSQL documentation ALTER STATISTICS <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable class="parameter">new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER } ALTER STATISTICS <replaceable class="parameter">name</replaceable> RENAME TO <replaceable class="parameter">new_name</replaceable> ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">new_schema</replaceable> -ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTICS <replaceable class="parameter">new_target</replaceable> +ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTICS { <replaceable class="parameter">new_target</replaceable> | DEFAULT } </synopsis> </refsynopsisdiv> @@ -101,10 +101,11 @@ ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTIC <para> The statistic-gathering target for this statistics object for subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> operations. - The target can be set in the range 0 to 10000; alternatively, set it - to -1 to revert to using the maximum of the statistics target of the - referenced columns, if set, or the system default statistics - target (<xref linkend="guc-default-statistics-target"/>). + The target can be set in the range 0 to 10000. Set it to + <literal>DEFAULT</literal> to revert to using the system default + statistics target (<xref linkend="guc-default-statistics-target"/>). + (Setting to a value of -1 is an obsolete way spelling to get the same + outcome.) For more information on the use of statistics by the <productname>PostgreSQL</productname> query planner, refer to <xref linkend="planner-stats"/>. |