Search Postgresql Archives

Re: Outer join with where conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 14, 2005 at 14:45:22 +0100,
  Michał Otroszczenko <michal.otroszczenko@xxxxxxxxx> wrote:
> Hello,
> 
> I wonder If I could move additional join condition from ON part of
> query to where part.

Yes, but the semantics are different for outer joins.

> 
> For example instead of:
> 
> SELECT *  FROM
>     booking_load AS bload
>     LEFT OUTER JOIN dict_load_type_tsl AS load_tsl ON (
>                     load_tsl.dict_load_type_id = bload.dict_load_type_id
>                     AND load_tsl.dict_language_id = 'EN' ))
> 
> Could I write:
> 
> SELECT *  FROM
>     booking_load AS bload
>     LEFT OUTER JOIN dict_load_type_tsl AS load_tsl USING (dict_load_type_id)
> WHERE
>      load_tsl.dict_language_id = 'EN'
> 
> I thought that second query could be more 'optimizable', but gave no results.
> Where is the problem ?
> 
> Best regards,
> Michal
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux