pgsql: Fix ndistinct estimates with system attributes

2021-03-26 Thread Tomas Vondra
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

pgsql: Fix ndistinct estimates with system attributes

2021-03-26 Thread Tomas Vondra
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

pgsql: Fix ndistinct estimates with system attributes

2021-03-26 Thread Tomas Vondra
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

pgsql: Fix ndistinct estimates with system attributes

2021-03-26 Thread Tomas Vondra
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

pgsql: Fix ndistinct estimates with system attributes

2021-03-26 Thread Tomas Vondra
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