postgresql/src/backend
Tomas Vondra 67251c82af 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:37:45 +01:00
..
access Fix bug in WAL replay of COMMIT_TS_SETTS record. 2021-03-25 11:24:20 +09:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY 2021-02-10 13:09:09 +09:00
commands Remove StoreSingleInheritance reimplementation 2021-03-25 10:47:38 -03:00
executor Revert "Fix race in Parallel Hash Join batch cleanup." 2021-03-18 01:00:56 +13:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit jit: Correct parameter type for generated expression evaluation functions. 2020-12-07 18:33:03 -08:00
lib Use pg_bitutils for HyperLogLog. 2020-07-30 09:17:00 -07:00
libpq Fix memory leak when rejecting bogus DH parameters. 2021-03-20 12:47:35 -04:00
main Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nodes Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:27 -05:00
optimizer Fix error with CREATE PUBLICATION, wal_level=minimal, and new tables. 2021-01-30 00:12:05 -08:00
parser Forbid marking an identity column as nullable. 2021-03-12 11:08:42 -05:00
partitioning Fix hash partition pruning with asymmetric partition sets. 2021-01-28 13:41:55 -05:00
po Translation updates 2021-02-08 17:41:32 +01:00
port Spelling adjustments 2020-06-07 15:06:51 +02:00
postmaster Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
regex Fix another ancient bug in parsing of BRE-mode regular expressions. 2021-02-18 22:38:55 -05:00
replication Don't leak malloc'd error string in libpqrcv_check_conninfo(). 2021-03-18 22:21:58 -04: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 copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Use correct spelling of statistics kind 2021-03-23 05:00:19 +01:00
storage Fix concurrency issues with WAL segment recycling on Windows 2021-03-22 14:02:36 +09:00
tcop Avoid crash when rolling back within a prepared statement. 2021-02-03 19:38:29 -05:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 21:44:43 -04:00
utils Fix ndistinct estimates with system attributes 2021-03-26 22:37:45 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Translation updates 2020-09-14 13:14:53 +02:00