Re: Future directions for inheritance-hierarchy statistics - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Future directions for inheritance-hierarchy statistics
Date
Msg-id CA+TgmoY17UEkf6133YC=utdXtxqkXLyE9f0CV-cqDRUwbMtKYw@mail.gmail.com
Whole thread Raw
In response to Re: Future directions for inheritance-hierarchy statistics  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: Future directions for inheritance-hierarchy statistics
List pgsql-hackers
For some reason, I didn't get Tom's email, only this reply.

On Tue, Mar 17, 2015 at 3:44 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:
> On 2015/03/17 5:18, Tom Lane wrote:
>> A few days ago I posted a very-much-WIP patch for making the planner
>> dynamically combine statistics for each member of an appendrel:
>> http://www.postgresql.org/message-id/22598.1425686096@sss.pgh.pa.us
>>
>> That patch was only intended to handle the case of an appendrel generated
>> by a UNION ALL construct.  But it occurs to me that we could easily
>> change it to also apply to appendrels generated from inheritance trees.
>> Then we'd no longer need the whole-inheritance-tree statistics that
>> ANALYZE currently produces, because we'd only ever look at per-table
>> statistics in pg_statistic.
>>
>> This would have one significant drawback, which is that planning for
>> large inheritance trees (many children) would probably get noticeably
>> slower.  (But in the common case that constraint exclusion limits a
>> query to scanning just one or a few children, the hit would be small.)

That's a pretty big drawback.  I'm not sure whether it's big enough to
sink the whole idea, but we really need to make planning time on large
inheritance trees cheaper, not more expensive.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Next
From: Ashutosh Bapat
Date:
Subject: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)