Re: OUTER JOIN performance regression remains in 8.3beta4

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OUTER JOIN performance regression remains in 8.3beta4
Date: 2008-01-09 19:05:07
Message-ID: 871w8qlt0c.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> As an example, consider
> t1 join t2 on (...) join t3 on (...) ... join t8 on (...)
> and for simplicity suppose that each ON condition relates the new
> table to the immediately preceding table, and that we can't derive
> any additional join conditions through transitivity.

So the problem is that if we happen to have some x=<const> clause for any
variable listed in those join clauses then we drop that clause entirely and
end up delaying that join until the very end?

So is the fact that the user provided a useless clause the only information we
have that these tables might be related?

So if I write (along with some other joins):

t1 join t2 on (t1.x=t2.x) where t1.x=3

I'll get a different result than if I write

t1, t2 where t1.x=3 and t2.x=3

?

Perhaps we could be going the other direction and trying to add redundant
selectivity 1.0 clauses when we have multiple variables which come out to the
same value?

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-01-09 19:13:22 Re: Problem with CVS HEAD's handling of mergejoins
Previous Message Gavin Sherry 2008-01-09 19:03:13 Re: Dynamic Partitioning using Segment Visibility Maps

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-01-09 19:22:49 Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Previous Message Alvaro Herrera 2008-01-09 18:07:38 Re: BUG #3860: xpath crashes backend when is querying xmlagg result