From ce7565ab91100747d250ef67d72af5c1b01150d4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 31 Jul 2002 17:19:54 +0000 Subject: 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. --- doc/src/sgml/catalogs.sgml | 7 ++++--- doc/src/sgml/ref/alter_table.sgml | 4 +++- doc/src/sgml/ref/analyze.sgml | 10 ++++++---- doc/src/sgml/runtime.sgml | 15 ++++++++++++++- 4 files changed, 27 insertions(+), 9 deletions(-) (limited to 'doc/src') 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 @@ @@ -672,8 +672,9 @@ of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. - The exact meaning of positive values is data type-dependent. - For scalar data types, attstattarget + A negative value says to use the system default statistics target. + The exact meaning of positive values is datatype-dependent. + For scalar datatypes, attstattarget is both the target number of most common values to collect, and the target number of histogram bins to create. 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 @@ @@ -218,6 +218,8 @@ ALTER TABLE table This form sets the per-column statistics-gathering target for subsequent 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. 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 @@ @@ -157,7 +157,9 @@ ANALYZE [ VERBOSE ] [ table [ ( - The extent of analysis can be controlled by adjusting the per-column + The extent of analysis can be controlled by adjusting the + default_statistics_target parameter variable, or on a + column-by-column basis by setting the per-column statistics target with ALTER TABLE ALTER COLUMN SET STATISTICS (see ). The @@ -165,8 +167,8 @@ ANALYZE [ VERBOSE ] [ table [ (ANALYZE and the - amount of space occupied in pg_statistic. + ANALYZE and the amount of space occupied + in pg_statistic. 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 @@ @@ -592,6 +592,19 @@ env PGOPTIONS='-c geqo=off' psql + + DEFAULT_STATISTICS_TARGET (integer) + + + Sets the default statistics target for table columns that have not + had a column-specific target set via ALTER TABLE SET + STATISTICS. Larger values increase the time needed to do + ANALYZE, but may improve the quality of the planner's + estimates. + + + + EFFECTIVE_CACHE_SIZE (floating point) -- cgit v1.2.3