postgresql/src/backend/utils
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
..
adt Avoid believing incomplete MCV-only stats in get_variable_range(). 2021-10-01 14:59:35 -04:00
cache Fix assign_record_type_typmod(). 2021-07-10 10:28:15 -07:00
error Re-implement the ereport() macro using __VA_ARGS__. 2020-03-24 11:48:33 -04:00
fmgr Fix broken ruleutils support for function TRANSFORM clauses. 2021-01-25 13:03:11 -05:00
hash Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
init Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
mb Avoid unnecessary out-of-memory errors during encoding conversion. 2019-10-03 17:34:25 -04:00
misc Set pg_setting.pending_restart when pertinent config lines are removed 2021-07-27 15:44:12 -04:00
mmgr Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
resowner Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
sort Robustify tuplesort's free_sort_tuple function 2021-07-13 13:30:26 +12:00
time Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
errcodes.txt Make SQL/JSON error code names match SQL standard 2019-08-22 10:45:25 +02:00
Gen_dummy_probes.pl Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
Gen_dummy_probes.sed Update copyright for 2019 2019-01-02 12:44:25 -05:00
Gen_fmgrtab.pl Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
generate-errcodes.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Use Getopt::Long for catalog scripts 2019-02-12 12:22:08 -03:00
probes.d Sync our DTrace infrastructure with c.h's definition of type bool. 2019-11-06 11:11:45 -05:00