Re: - Slow Query

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Rui Carvalho <rui(dot)hmcarvalho(at)gmail(dot)com>
Cc: Mike Ivanov <mikei(at)activestate(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: - Slow Query
Date: 2009-07-01 17:42:35
Message-ID: dcc563d10907011042o7936fe16q6b04c4d7369bb472@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jul 1, 2009 at 11:37 AM, Rui Carvalho<rui(dot)hmcarvalho(at)gmail(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-07-01 17:52:51 Re: - Slow Query
Previous Message Rui Carvalho 2009-07-01 17:37:30 Re: - Slow Query