Re: Join optimization for inheritance tables

From: Emmanuel Cecchet <manu(at)asterdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Herodotos Herodotou <Herodotos(dot)Herodotou(at)asterdata(dot)com>, 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>, "hero(at)cs(dot)duke(dot)edu" <hero(at)cs(dot)duke(dot)edu>, "nedyalko(at)cs(dot)duke(dot)edu" <nedyalko(at)cs(dot)duke(dot)edu>
Subject: Re: Join optimization for inheritance tables
Date: 2009-09-22 22:16:33
Message-ID: 4AB94CC1.5040700@asterdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom,

If the partitioning implementation does not make progress (and does not
make it for 8.5), don't you think that this could be an interesting
contribution to consider for this release?
I have put on the wiki
(http://wiki.postgresql.org/wiki/Join_optimization_for_inheritance_tables)
the results obtained so far and the use case where it is most used.

As I understand it, partitioning will certainly lead to some significant
changes/enhancements to the planner. Do you think it is realistic to get
that for 8.5?

manu

> Herodotos Herodotou <Herodotos(dot)Herodotou(at)asterdata(dot)com> writes:
>
>> This patch extends the query optimizer to consider joins between child tables when hierarchies are joined together.
>>
>
> I looked over this patch a bit. I am of the opinion that this is a lot
> of work towards a dead-end direction :-(. The patch contains a large
> amount of rather inefficient code that attempts to reverse-engineer
> knowledge about whether an inheritance tree forms a range-partitioned
> table. We already know that reasoning from first principles using a set
> of arbitrary per-table constraints doesn't scale very well, and this
> would make it a lot worse. pgsql-hackers have been talking for some
> time about implementing an explicit partitioning feature, which would
> give the planner direct knowledge about this type of table structure
> without expending nearly so much work (and then expending it all over
> again for the next query). I think the right way to go at it is to
> implement that first, and then see about teaching the planner to plan
> like this.
>
> We could possibly extract a subset of the patch that just deals with
> pushing joins down through appends, without the constraint-exclusion
> logic that tries to eliminate provably empty join pairs. But I'm
> dubious that that would be worthwhile by itself. I think you need the
> constraint exclusion to eliminate a good deal of work before this is
> actually better than doing a single join above the append.
>
> There are a number of other things I don't like, such as the restrictive
> and not-obviously-necessary requirement that all the join clauses be
> simple "Var op Var" clauses. But the main thing is that a large
> fraction of the patch is doing something I don't think we should try
> to do.
>
> regards, tom lane
>
>

--
Emmanuel Cecchet
Aster Data Systems
Web: http://www.asterdata.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2009-09-22 23:17:20 Re: [PATCH] pgbench: new feature allowing to launch shell commands
Previous Message Dimitri Fontaine 2009-09-22 20:40:58 Re: Anonymous code blocks