Hi,

On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat
<ashutosh.ba...@enterprisedb.com> wrote:
> @@ -7306,7 +7306,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration 
> count&gt;</replaceable>:<replaceable>&l
>    <para>
>     Normally there is one entry, with <structfield>stainherit</structfield> =
>     <literal>false</literal>, for each table column that has been analyzed.
> -   If the table has inheritance children, a second entry with
> +   If the table has inheritance children or partitions, a second entry with
>     <structfield>stainherit</structfield> = <literal>true</literal> is also 
> created.  This row
>     represents the column's statistics over the inheritance tree, i.e.,
>     statistics for the data you'd see with
>
> For partitioned tables only the second entry makes sense. IIRC, we had done 
> some work to remove the first entry. Can you please check whether a 
> partitioned table also has two entries?

Don't think we've made any changes yet that get rid of the parent
partitioned table's entry in pg_statistic:

create table foo (a int) partition by list (a);
create table foo1 partition of foo for values in (1);
analyze foo;
select starelid::regclass, stainherit from pg_statistic where
starelid::regclass in (select relid from pg_partition_tree('foo'));
 starelid | stainherit
----------+------------
 foo      | t
 foo1     | f
(2 rows)

Maybe you're thinking of RangeTblEntry that the planner makes 2 copies
for inheritance parents, but only 1 for partition parents as of
e8d5dd6be79.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com


Reply via email to