Re: extended stats on partitioned tables

Tomas Vondra <tomas.vondra@enterprisedb.com>

From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Zhihong Yu <zyu@yugabyte.com>, Jaime Casanova <jcasanov@systemguards.com.ec>, pgsql-hackers@postgresql.org
Date: 2022-01-16T23:44:50Z
Lists: pgsql-hackers
I've pushed the part adding stxdinherit flag to the catalog, so that on 
master we build statistics both with and without data from the child 
relations.

I'm not going to push the ACL refactoring. We have similar code on 
various other places (not addressed by the proposed patch), and it'd 
make backpatching harder. So I'm not sure it'd be an improvement.

In any case, I'm going to mark this as committed. Justin, if you think 
we should reconsider the ACL refactoring, please submit it as a separate 
patch. It seems mostly unrelated to the issue this thread was about.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Commits

  1. Add stxdinherit flag to pg_statistic_ext_data

  2. Build inherited extended stats on partitioned tables

  3. Ignore extended statistics for inheritance trees

  4. Don't build extended statistics on inheritance trees

  5. Tighten up relation kind checks for extended statistics

  6. Avoid assuming that statistics for a parent relation reflect the properties of