Alexander Staubo <[EMAIL PROTECTED]> writes:
> select comments.*, users.*
> from comments
> left outer join users on
>    users.id = comments.creator_id
> inner join events_comments on
>    comments.id = events_comments.comment_id
>    and events_comments.event_id = 9244

> The outer join seems unnecessarily slow.

Try flipping the order of the two joins.  PG 8.2 will be smart enough to
do that for itself, but no existing release understands when it's safe
to rearrange outer-join order.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to