Re: Join optimization for inheritance tables

From: Herodotos Herodotou <hero(at)cs(dot)duke(dot)edu>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Emmanuel Cecchet <manu(at)asterdata(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Eric Friedman <Eric(dot)Friedman(at)asterdata(dot)com>, John Cieslewicz <John(dot)Cieslewicz(at)asterdata(dot)com>, Dheeraj Pandey <Dheeraj(dot)Pandey(at)asterdata(dot)com>, "nedyalko(at)cs(dot)duke(dot)edu" <nedyalko(at)cs(dot)duke(dot)edu>
Subject: Re: Join optimization for inheritance tables
Date: 2009-09-24 23:49:35
Message-ID: 48f0b7a60909241649y4922519ajd45b0b3467a3c7c9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jeff,

On Tue, Sep 22, 2009 at 8:06 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> I think you mean that the planning time is in milliseconds, not seconds.
>

The planning time is actually in seconds. Even without our feature,
planning takes a few seconds since the optimizer deals with hundreds
or even thousands of child tables. With our feature, planning time
increases by 2-3X but then again, running time improves by 6-10X. I
have added a paragraph under performance evaluation in the wiki page (
http://wiki.postgresql.org/wiki/Join_optimization_for_inheritance_tables
) in order to provide a better insight on what's happening under the
covers.

> The results seem good, and trading planning time for execution time
> seems like a reasonable idea in the case of partitioned tables. We
> already work harder planning when constraint_exclusion='partition', so
> there is some precedent (I don't know if that's a good precedent to
> follow or not).
>

With constraint_exclusion=partition, single child tables that cannot
produce tuples (based on their check constraints and filter
conditions) are filtered out. Our patch goes one step further by
identifying which joins of child tables can/cannot produce tuples
(based on their check constraints and join conditions).

> How does it compare to using merge-append?
>

Merge-append is essentially a special case of our patch. Greg Stark
compared it with our patch and made some good commends in a previous
email thread ( message id =
407d949e0907061514i5f1a044r691d1d74eaefb067(at)mail(dot)gmail(dot)com )

Thank you,

~Hero

--
Herodotos Herodotou
Graduate Student
Department of Computer Science, Duke University
Email: hero(at)cs(dot)duke(dot)edu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-09-25 00:10:08 Re: [PATCH] Largeobject access controls
Previous Message Joachim Wieland 2009-09-24 22:55:14 Patch for information_schema performance