Re: extended stats on partitioned tables

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extended stats on partitioned tables
Date: 2021-12-12 17:45:43
Message-ID: c197968e-431b-997e-7a06-4c44afcb4d27@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/12/21 14:47, Zhihong Yu wrote:
>
>
> On Sat, Dec 11, 2021 at 9:14 PM Tomas Vondra
> <tomas(dot)vondra(at)enterprisedb(dot)com <mailto:tomas(dot)vondra(at)enterprisedb(dot)com>>
> wrote:
>
> ...
>
> > +       /* skip statistics with mismatching stxdinherit value */
> > +       if (stat->inherit != rte->inh)
> >
> > Should a log be added for the above case ?
> >
>
> Why should we log this? It's an entirely expected case - there's a
> mismatch between inheritance for the relation and statistics, simply
> skipping it is the right thing to do.
>
>
> Hi,
> I agree that skipping should be fine (to avoid too much logging).
>

I'm not sure it's related to the amount of logging, really. It'd be just
noise without any practical use, even for debugging purposes. If you
have an inheritance tree, it'll automatically have one set of statistics
for inh=true and one for inh=false. And this condition will always skip
one of those, depending on what query is being estimated.

regards

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-12-12 17:52:00 Re: extended stats on partitioned tables
Previous Message Gunnar "Nick" Bluth 2021-12-12 16:20:58 [PATCH] pg_stat_toast