未验证 提交 78d7d81d 编写于 作者: D David Yozie 提交者: GitHub

correcting range, defaults, and normalizing docs around default_statistics_target (#3819)

上级 bea6a32f
......@@ -329,8 +329,8 @@
<codeph>default_statistics_target</codeph> server configuration parameter. The default
value is usually sufficient, and you should only raise or lower it if your tests
demonstrate that query plans improve with the new target. For example, to raise the
default statistics target from 25 to 50 you can use the <codeph>gpconfig</codeph>
utility:<codeblock>gpconfig -c default_statistics_target -v 50</codeblock></p>
default statistics target from 100 to 150 you can use the <codeph>gpconfig</codeph>
utility:<codeblock>gpconfig -c default_statistics_target -v 150</codeblock></p>
<p>The statististics target for individual columns can be set with the <codeph>ALTER
TABLE</codeph> command. For example, some queries can be improved by increasing the
target for certain columns, especially columns that have irregular distributions. You can
......
......@@ -135,7 +135,7 @@
<codeblock>ALTER TABLE sales ALTER COLUMN region SET STATISTICS 50;
</codeblock>
</p>
<p>This is equivalent to increasing <codeph>default_statistics_target</codeph> for a
<p>This is equivalent to changing <codeph>default_statistics_target</codeph> for a
particular column. Subsequent <codeph>ANALYZE</codeph> operations will then gather more
statistics data for that column and produce better query plans as a result.</p>
</body>
......
......@@ -35,14 +35,14 @@
quality, or accuracy, of the statistics. </p>
<p>To allow large tables to be analyzed in a reasonable amount of time,
<codeph>ANALYZE</codeph> takes a random sample of the table contents, rather than
examining every row. To increase sampling for all table columns adjust the
<codeph>default_statistics_target</codeph> configuration parameter. The target value
ranges from 1 to 1000; the default target value is 25. The
<codeph>default_statistics_target</codeph> variable applies to all columns by default. A
larger target value increases the time needed to perform the <codeph>ANALYZE</codeph>, but
may improve the quality of the query planner’s estimates. This is especially true for
columns with irregular data patterns. <codeph>default_statistics_target</codeph> can be set
at the master/session level and requires a reload. </p>
examining every row. To increase the number of sample values for all table columns adjust
the <codeph>default_statistics_target</codeph> configuration parameter. The target value
ranges from 1 to 1000; the default target value is 100. The
<codeph>default_statistics_target</codeph> variable applies to all columns by default, and
specifies the number of values that are stored in the list of common values. A larger target
may improve the quality of the query planner’s estimates, especially for columns with
irregular data patterns. <codeph>default_statistics_target</codeph> can be set at the
master/session level and requires a reload. </p>
<p>The <codeph>gp_analyze_relative_error</codeph> configuration parameter affects the sampling
rate during statistics collection to determine cardinality in a column. For example, a value
of .5 is equivalent to an acceptable error of 50%. The default is .25. Use the
......
......@@ -1659,10 +1659,10 @@
<topic id="default_statistics_target">
<title>default_statistics_target</title>
<body>
<p>Sets the default statistics target for table columns that have not had a column-specific
target set via <codeph>ALTER TABLE SET STATISTICS</codeph>. Larger values increase the time
needed to do <codeph>ANALYZE</codeph>, but may improve the quality of the legacy query
optimizer (planner) estimates.</p>
<p>Sets the default statistics sampling target (the number of values that are stored in the
list of common values) for table columns that have not had a column-specific target set via
<codeph>ALTER TABLE SET STATISTICS</codeph>. Larger values may improve the quality of the
legacy query optimizer (planner) estimates. </p>
<table id="default_statistics_target_table">
<tgroup cols="3">
<colspec colnum="1" colname="col1" colwidth="1*"/>
......
......@@ -150,7 +150,7 @@ ALTER TABLE <varname>name</varname>
<li id="ay136944"><b>SET STATISTICS</b> — Sets the per-column
statistics-gathering target for subsequent
<codeph>ANALYZE</codeph> operations. The target can
be set in the range 0 to 1000, or set to -1 to revert to
be set in the range 1 to 1000, or set to -1 to revert to
using the system default statistics target
(<codeph>default_statistics_target</codeph>).</li>
<li id="ay137022"><b>ADD <varname>table_constraint</varname></b>
......
......@@ -157,7 +157,7 @@
column-by-column basis by setting the per-column statistics target with <codeph>ALTER TABLE
... ALTER COLUMN ... SET STATISTICS</codeph> (see <codeph>ALTER TABLE</codeph>). The
target value sets the maximum number of entries in the most-common-value list and the
maximum number of bins in the histogram. The default target value is 10, but this can be
maximum number of bins in the histogram. The default target value is 100, but this can be
adjusted up or down to trade off accuracy of planner estimates against the time taken for
<codeph>ANALYZE</codeph> and the amount of space occupied in
<codeph>pg_statistic</codeph>. In particular, setting the statistics target to zero disables
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册