postgresql/src
Tomas Vondra 36c4bc6e72 Ignore extended statistics for inheritance trees
Since commit 859b3003de we only build extended statistics for individual
relations, ignoring the child relations. This resolved the issue with
updating catalog tuple twice, but we still tried to use the statistics
when calculating estimates for the whole inheritance tree. When the
relations contain very distinct data, it may produce bogus estimates.

This is roughly the same issue 427c6b5b9 addressed ~15 years ago, and we
fix it the same way - by ignoring extended statistics when calculating
estimates for the inheritance tree as a whole. We still consider
extended statistics when calculating estimates for individual child
relations, of course.

This may result in plan changes due to different estimates, but if the
old statistics were not describing the inheritance tree particularly
well it's quite likely the new plans is actually better.

Report and patch by Justin Pryzby, minor fixes and cleanup by me.
Backpatch all the way back to PostgreSQL 10, where extended statistics
were introduced (same as 859b3003de).

Author: Justin Pryzby
Reported-by: Justin Pryzby
Backpatch-through: 10
Discussion: https://postgr.es/m/20210923212624.GI831%40telsasoft.com
2022-01-15 02:20:54 +01:00
..
backend Ignore extended statistics for inheritance trees 2022-01-15 02:20:54 +01:00
bin Clean up messy API for src/port/thread.c. 2022-01-11 13:46:20 -05:00
common Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
fe_utils Update copyright for 2022 2022-01-07 19:04:57 -05:00
include Unify VACUUM VERBOSE and autovacuum logging. 2022-01-14 16:50:34 -08:00
interfaces Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
port Clean up messy API for src/port/thread.c. 2022-01-11 13:46:20 -05:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Ignore extended statistics for inheritance trees 2022-01-15 02:20:54 +01:00
timezone Update copyright for 2022 2022-01-07 19:04:57 -05:00
tools Revert "Test replay of regression tests." 2022-01-15 00:44:32 +13:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Add support for LZ4 compression in pg_receivewal 2021-11-05 11:33:25 +09:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00