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