postgresql/src
Tom Lane 334fb8c3de Avoid believing incomplete MCV-only stats in get_variable_range().
get_variable_range() would incautiously believe that statistics
containing only an MCV list are sufficient to derive a range estimate.
That's okay for an enum-like column that contains only MCVs, but
otherwise the estimate could be pretty bad.  Make it report that the
range is indeterminate unless the MCVs plus nullfrac account for
the whole table.

I don't think this needs a dedicated test case, since a quick code
coverage check verifies that the existing regression tests traverse
all the alternatives.  There is room to doubt that a future-proof
test case could be built anyway, given that the submitted example
accidentally doesn't fail before v11.

Per bug #17207 from Simon Perepelitsa.  Back-patch to v10.
In principle this has been broken all along, but I'm hesitant to
make such changes in 9.6, since if anyone is unhappy with 9.6.24's
behavior there will be no second chance to fix it.

Discussion: https://postgr.es/m/17207-5265aefa79e333b4@postgresql.org
2021-10-01 14:59:35 -04:00
..
backend Avoid believing incomplete MCV-only stats in get_variable_range(). 2021-10-01 14:59:35 -04:00
bin pgbench: Fix handling of socket errors during benchmark. 2021-09-29 21:49:40 +09:00
common Fix command-line colorization on Windows with VT100-compatible environments 2020-03-02 15:46:24 +09:00
fe_utils Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
include
interfaces Fix error handling with threads on OOM in ECPG connection logic 2021-09-13 13:24:27 +09:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
port
template
test
timezone
tools Fix WAL replay in presence of an incomplete record 2021-09-29 11:21:51 -03:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in
Makefile.shlib
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:05:50 +02:00