Revision 9387f4e1bdc25d2c49a820365c298280f2e8a066 authored by Tom Lane on 11 January 2014, 18:41:41 UTC, committed by Tom Lane on 11 January 2014, 18:42:00 UTC
The standard typanalyze functions skip over values whose detoasted size exceeds WIDTH_THRESHOLD (1024 bytes), so as to limit memory bloat during ANALYZE. However, we (I think I, actually :-() failed to consider the possibility that *every* non-null value in a column is too wide. While compute_minimal_stats() seems to behave reasonably anyway in such a case, compute_scalar_stats() just fell through and generated no pg_statistic entry at all. That's unnecessarily pessimistic: we can still produce valid stanullfrac and stawidth values in such cases, since we do include too-wide values in the average-width calculation. Furthermore, since the general assumption in this code is that too-wide values are probably all distinct from each other, it seems reasonable to set stadistinct to -1 ("all distinct"). Per complaint from Kadri Raudsepp. This has been like this since roughly neolithic times, so back-patch to all supported branches.
1 parent 9f5b3a1
File | Mode | Size |
---|---|---|
config | ||
contrib | ||
doc | ||
src | ||
.gitignore | -rw-r--r-- | 360 bytes |
COPYRIGHT | -rw-r--r-- | 1.2 KB |
GNUmakefile.in | -rw-r--r-- | 3.7 KB |
Makefile | -rw-r--r-- | 1.5 KB |
README | -rw-r--r-- | 1.3 KB |
README.git | -rw-r--r-- | 816 bytes |
aclocal.m4 | -rw-r--r-- | 385 bytes |
configure | -rwxr-xr-x | 850.2 KB |
configure.in | -rw-r--r-- | 62.7 KB |
Computing file changes ...