postgresql/src/backend
Tomas Vondra 33e52ad9a3 Fix ndistinct estimates with system attributes
When estimating the number of groups using extended statistics, the code
was discarding information about system attributes. This led to strange
situation that

    SELECT 1 FROM t GROUP BY ctid;

could have produced higher estimate (equal to pg_class.reltuples) than

    SELECT 1 FROM t GROUP BY a, b, ctid;

with extended statistics on (a,b). Fixed by retaining information about
the system attribute.

Backpatch all the way to 10, where extended statistics were introduced.

Author: Tomas Vondra
Backpatch-through: 10
2021-03-26 22:34:58 +01:00
..
access Fix alignment in BRIN minmax-multi deserialization 2021-03-26 16:48:36 +01:00
bootstrap Allow composite types in catalog bootstrap 2021-03-24 00:47:52 +01:00
catalog Add "pg_database_owner" default role. 2021-03-26 10:42:17 -07:00
commands Add "pg_database_owner" default role. 2021-03-26 10:42:17 -07:00
executor ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Fix memory leak when rejecting bogus DH parameters. 2021-03-20 12:47:21 -04:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
optimizer ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
parser ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
partitioning ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
postmaster Improve connection denied error message during recovery. 2021-03-25 10:41:28 +09:00
regex Further tweak memory management for regex DFAs. 2021-03-08 16:32:29 -05:00
replication Sanitize the term "combo CID" in code comments 2021-03-25 16:08:03 +09:00
rewrite Revert "Propagate CTE property flags when copying a CTE list into a rule." 2021-02-07 12:54:08 -05:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Use correct spelling of statistics kind 2021-03-23 05:01:35 +01:00
storage Fix concurrency issues with WAL segment recycling on Windows 2021-03-22 14:02:26 +09:00
tcop ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 22:22:47 -04:00
utils Fix ndistinct estimates with system attributes 2021-03-26 22:34:58 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00