Subject Re: [firebird-support] Re: Optimizer issue with left outer joins?
Author Bradley Tate
Sorry, this was 1.5. The work-arounds work but from our point of view
left outer joins seem to cause us a lot of grief - i.e. the optimizer
doesn't treat them nicely and they are a bit of a trap for some of our
programmers.

Cheers and thanks.

Svein Erling wrote:

> Changing to
>
> SELECT
> phone.*
> from phonlink
> INNER JOIN phone
> ON phone.phoneref = phonlink.phoneref+0 //'+0' is the difference
> left outer join emailoptions
> ON phone.emailtype = emailoptions.emailtype
> WHERE phonlink.loclinkref = 'LO00000004'
>
> could solve your immediate problem. Though try Fb 1.5 as Carlos
> recommended you to see if that makes a difference.
>
> Set
>
> --- In firebird-support@yahoogroups.com, Bradley Tate wrote:
> > Hi
> >
> > I am starting think the firebird optimizer has some real problems
> > with left outer joins or there is something I don't understand about
> > indexes. As soon as you seem to use a left outer join it seems to
> > think it needs to do a table scan. If you run the sql below it does
> > a table scan of the phone table. With a inner join instead of the
> > outer it works correctly.
>