Re: Future directions for inheritance-hierarchy statistics

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Future directions for inheritance-hierarchy statistics
Date: 2015-03-17 15:14:48
Message-ID: CA+TgmoY17UEkf6133YC=utdXtxqkXLyE9f0CV-cqDRUwbMtKYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)etsuro(at)lab(dot)ntt(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2015-03-17 15:24:31 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Previous Message Robert Haas 2015-03-17 15:04:48 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)