Subject Re: Why does this query take forever in FB?!?!
Author rjschappe
>Raymond, let me answer in descending order.
>Why. Because FB serves IN (Select ...) scanning
>table in main select and performing subquery.
>Seemingly, MS SQL perform subselect once and perhaps
>use indices on main table if it is possible.
>
>select LO.Color, LO.Width, LO.LamLength
>from LamOrder LO join OrderItem OI on LO.CustOrder=OI.CustOrder
> join LamColor LC on OI.Color = LC.ID
>where (OI.ItemFlags=1 or OI.ItemFlags=3)
> and LC.LamMaker=4

Alexander,

Thanks for the quick response!!! I am still getting used to the way
FB does things... it is a journey, but I am sure it will be worth it!

I added a group by, and order by and still your query came back in
_less_ than a second!!!! :)

Thanks again for the help,
--Raymond