Re: - Slow Query - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: - Slow Query
Date
Msg-id dcc563d10907011042o7936fe16q6b04c4d7369bb472@mail.gmail.com
Whole thread Raw
In response to Re: - Slow Query  (Rui Carvalho <rui.hmcarvalho@gmail.com>)
Responses Re: - Slow Query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Wed, Jul 1, 2009 at 11:37 AM, Rui Carvalho<rui.hmcarvalho@gmail.com> wrote:
> hum thanks a lot for the quick answer,
>
> if is not abuse of your patience
>
> what is the best alternative to the LEFT OUTER JOINS?

Hard to say.  Generally, when you really do need a left, right, or
full outer join, you need it, and there's not a lot of alternatives.
Sometimes putting a where clause portion into the on clause helps.
like:

select * from a left join b on (a.id=b.id) where a.somefield=2

might run faster with

select * from a left join b on (a.id=bid. and a.somefield=2);

but it's hard to say.  I'd definitely post it to the list and see who
knows what.

pgsql-performance by date:

Previous
From: Rui Carvalho
Date:
Subject: Re: - Slow Query
Next
From: Tom Lane
Date:
Subject: Re: - Slow Query