Re: inheritance: planning time vs children number vs column number - Mailing list pgsql-performance

From Tom Lane
Subject Re: inheritance: planning time vs children number vs column number
Date
Msg-id 22075.1299000834@sss.pgh.pa.us
Whole thread Raw
In response to Re: inheritance: planning time vs children number vs column number  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
I wrote:
> Marc Cousin <cousinmarc@gmail.com> writes:
>> Yes, for the same test case, with a bit of data in every partition and
>> statistics up to date, planning time goes from 20 seconds to 125ms for the 600
>> children/1000 columns case. Which is of course more than acceptable.

> [ scratches head ... ]  Actually, I was expecting the runtime to go up
> not down.  Maybe there's something else strange going on here.

Oh, doh: the failing pg_statistic lookups are all coming from the part
of estimate_rel_size() where it tries to induce a reasonable tuple width
estimate for an empty table (see get_rel_data_width).  Probably not a
case we need to get really tense about.  Of course, you could also argue
that this code is stupid because it's very unlikely that there will be
any pg_statistic entries either.  Maybe we should just have it go
directly to the datatype-based estimate instead of making a boatload
of useless pg_statistic probes.

            regards, tom lane

pgsql-performance by date:

Previous
From: Maciek Sakrejda
Date:
Subject: Re: Two different execution plans for similar requests
Next
From: sverhagen
Date:
Subject: Performance trouble finding records through related records