Re: Propagating outer join conditions - Mailing list pgsql-performance

From Aaron Birkland
Subject Re: Propagating outer join conditions
Date
Msg-id 19ab0ccd0612030830t68d9a7ddoba02f060fd9cdea4@mail.gmail.com
Whole thread Raw
In response to Re: Propagating outer join conditions  ("Jonathan Blitz" <jb@anykey.co.il>)
List pgsql-performance
First, I forgot to mention - this is 8.2 RC1 I was trying on

The suggested change produces an identical 'bad' query plan.  The main
issue (I think) is that the query node that processes "t1 JOIN t11 ON
..' is not aware of the join condition 't28.s = t1.s'.. even though
the value of t28.s (as determined by the inner index scan where t28.o
= 'spec') could(should?) theoretically be known to it. If it did, then
I imagine it would realize that a nested loop join starting with t1.s
= t28.s (which is very selective) would be much cheaper than doing the
big merge join.

  -Aaron

On 12/3/06, Jonathan Blitz <jb@anykey.co.il> wrote:
> How about trying:
>
> Select *
> From
> (Select * from t28 where t28.0='spec')  t28a
> Left out join (t1 JOIN t11 ON
> > (t11.o = '<http://example.org>' AND t11.s = t1.o)) ON t28a.s = t1.s
>
> In this way, I think, the where clause on t28 would be performed before the
> join rather than after.

pgsql-performance by date:

Previous
From: "Jonathan Blitz"
Date:
Subject: Re: Propagating outer join conditions
Next
From: "Alexandru Coseru"
Date:
Subject: Hardware advice