diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-31 17:19:54 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-31 17:19:54 +0000 |
commit | ce7565ab91100747d250ef67d72af5c1b01150d4 (patch) | |
tree | 968d1af6054a60d13e292d786c2f695da02b2a9d /doc/src | |
parent | 8be3cfbbd5e9afaa77a86251566d3ca04217fcb2 (diff) | |
download | postgresql-ce7565ab91100747d250ef67d72af5c1b01150d4.tar.gz postgresql-ce7565ab91100747d250ef67d72af5c1b01150d4.zip |
Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 in
attstattarget to indicate 'use the default'. The default is now a GUC
variable default_statistics_target, and so may be changed on the fly. Along
the way we gain the ability to have pg_dump dump the per-column statistics
target when it's not the default. Patch by Neil Conway, with some kibitzing
from Tom Lane.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 7 | ||||
-rw-r--r-- | doc/src/sgml/ref/alter_table.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/analyze.sgml | 10 | ||||
-rw-r--r-- | doc/src/sgml/runtime.sgml | 15 |
4 files changed, 27 insertions, 9 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 13f883a65de..8bf4bf816f0 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ <!-- Documentation of the system catalogs, directed toward PostgreSQL developers - $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.49 2002/07/30 05:24:56 tgl Exp $ + $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.50 2002/07/31 17:19:49 tgl Exp $ --> <chapter id="catalogs"> @@ -672,8 +672,9 @@ of statistics accumulated for this column by <command>ANALYZE</command>. A zero value indicates that no statistics should be collected. - The exact meaning of positive values is data type-dependent. - For scalar data types, <structfield>attstattarget</structfield> + A negative value says to use the system default statistics target. + The exact meaning of positive values is datatype-dependent. + For scalar datatypes, <structfield>attstattarget</structfield> is both the target number of <quote>most common values</quote> to collect, and the target number of histogram bins to create. </entry> diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 9acd474203c..11da9fdf60c 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.46 2002/07/12 18:43:12 tgl Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.47 2002/07/31 17:19:50 tgl Exp $ PostgreSQL documentation --> @@ -218,6 +218,8 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable> This form sets the per-column statistics-gathering target for subsequent <xref linkend="sql-analyze" endterm="sql-analyze-title"> operations. + The target can be set in the range 0 to 1000; alternatively, set it + to -1 to revert to using the system default statistics target. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/analyze.sgml b/doc/src/sgml/ref/analyze.sgml index 5fbef560dec..72dc5cdcdeb 100644 --- a/doc/src/sgml/ref/analyze.sgml +++ b/doc/src/sgml/ref/analyze.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/ref/analyze.sgml,v 1.8 2002/04/23 02:07:15 tgl Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/analyze.sgml,v 1.9 2002/07/31 17:19:51 tgl Exp $ PostgreSQL documentation --> @@ -157,7 +157,9 @@ ANALYZE [ VERBOSE ] [ <replaceable class="PARAMETER">table</replaceable> [ (<rep </para> <para> - The extent of analysis can be controlled by adjusting the per-column + The extent of analysis can be controlled by adjusting the + <literal>default_statistics_target</> parameter variable, or on a + column-by-column basis by setting the per-column statistics target with <command>ALTER TABLE ALTER COLUMN SET STATISTICS</command> (see <xref linkend="sql-altertable" endterm="sql-altertable-title">). The @@ -165,8 +167,8 @@ ANALYZE [ VERBOSE ] [ <replaceable class="PARAMETER">table</replaceable> [ (<rep list and the maximum number of bins in the histogram. The default target value is 10, but this can be adjusted up or down to trade off accuracy of planner estimates against the time taken for - <command>ANALYZE</command> and the - amount of space occupied in <literal>pg_statistic</literal>. + <command>ANALYZE</command> and the amount of space occupied + in <literal>pg_statistic</literal>. In particular, setting the statistics target to zero disables collection of statistics for that column. It may be useful to do that for columns that are never used as part of the WHERE, GROUP BY, or ORDER BY clauses of diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 15f2e6e56af..8733725c2e3 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.121 2002/07/13 01:02:14 momjian Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.122 2002/07/31 17:19:50 tgl Exp $ --> <Chapter Id="runtime"> @@ -593,6 +593,19 @@ env PGOPTIONS='-c geqo=off' psql </varlistentry> <varlistentry> + <term><varname>DEFAULT_STATISTICS_TARGET</varname> (<type>integer</type>)</term> + <listitem> + <para> + Sets the default statistics target for table columns that have not + had a column-specific target set via <command>ALTER TABLE SET + STATISTICS</>. Larger values increase the time needed to do + <command>ANALYZE</>, but may improve the quality of the planner's + estimates. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><varname>EFFECTIVE_CACHE_SIZE</varname> (<type>floating point</type>)</term> <listitem> <para> |