histogram_bounds中的最大条目数 [英] Maximum amount of entries in the histogram_bounds
问题描述
当前默认限制是 pg_stats <
histogram_bounds
和 max_common_values
字段的100个条目/ code>视图。提高限制可能允许对Postgresql Planner的扫描行进行更准确的估计。在全球范围内,此设置是由default_statistics_target设置的,也可以使用 ALTER TABLE SET STATISTICS
命令逐列设置。
The default limit is presently 100 entries for histogram_bounds
and max_common_values
fields in pg_stats
view. Raising the limit might allow to be made more accurate estimates scanned rows for postgresql planner. Globally, this setting is set by default_statistics_target or can be set on a column-by-column basis using the ALTER TABLE SET STATISTICS
command.
可以设置此设置的最大值是什么?
What is the maximum value of this setting can be set?
UPD:
我发现如何查看此设置:
UPD: I found how to look this settings:
从pg_settings中选择名称,max_val,其中name ='default_statistics_target'
Select name, max_val from pg_settings where name='default_statistics_target'
推荐答案
每个文档(自9.3版开始):
Per the docs (as of 9.3):
设置统计
SET STATISTICS
此表单为随后的ANALYZE操作设置了按列收集统计信息的
目标。可以在
的范围内(0到10000)设置目标。或者,将其设置为-1以还原为使用
系统默认统计信息目标(default_statistics_target)。有关PostgreSQL查询计划程序使用统计信息的更多
信息,请参考$ 14.2。
This form sets the per-column statistics-gathering target for subsequent ANALYZE operations. The target can be set in the range 0 to 10000; alternatively, set it to -1 to revert to using the system default statistics target (default_statistics_target). For more information on the use of statistics by the PostgreSQL query planner, refer to Section 14.2.
http://www.postgresql.org/docs/current/static/sql -altertable.html
这篇关于histogram_bounds中的最大条目数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!