Re: Propagating outer join conditions

From: "Aaron Birkland" <apb18(at)cornell(dot)edu>
To: "Jonathan Blitz" <jb(at)anykey(dot)co(dot)il>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Propagating outer join conditions
Date: 2006-12-03 16:30:28
Message-ID: 19ab0ccd0612030830t68d9a7ddoba02f060fd9cdea4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)anykey(dot)co(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexandru Coseru 2006-12-03 17:29:02 Hardware advice
Previous Message Jonathan Blitz 2006-12-03 15:25:15 Re: Propagating outer join conditions