The default limit is presently 100 entries for
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: I found how to look this settings:
Select name, max_val from pg_settings where name='default_statistics_target'Answer1:
Per the docs (as of 9.3):<blockquote>
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.</blockquote>
<a href="http://www.postgresql.org/docs/current/static/sql-altertable.html" rel="nofollow">http://www.postgresql.org/docs/current/static/sql-altertable.html</a>