Re: Arghh! Please Help.
Posted in 1999
Topics: Performance & Tuning, SQL Development & Query Writing
OK, so my question to all of you is:
Why do you prefer Nested Loop Joins?
Isn't this begging things to go slow??? I can refer to Informix
training where NLJ's are strongly discouraged.
I'd say set the OPTCOMPIND=2, and NEVER go for nested loop joins.
If there is some magical reason for using NLJ's I'd really like to know.
Thanks,
Tim
> # OPTCOMPIND
> # 0 => Nested loop joins will be preferred (where
> # possible) over sortmerge joins and hash joins.
> # 1 => If the transaction isolation mode is not
> # "repeatable read", optimizer behaves as in (2)
> # below. Otherwise it behaves as in (0) above.
> # 2 => Use costs regardless of the transaction isolation
> # mode. Nested loop joins are not necessarily
> # preferred. Optimizer bases its decision purely
> # on costs.
> OPTCOMPIND 0 # To hint the optimizer>
--
-
--
--- Tim Schaefer
---- tschaefe@mindspring.com
--- http://www.inxutil.com
--
-
Tim Schaefer (tschaefe@mindspring.com) wrote: : Why do you prefer Nested Loop Joins? The only reason I can think of is that NLJ's get the first row back quickly. Other than that, I tend to agree with you. KR Pb