I nearly always have issues with
blanket statements on performance. That includes the statement that EXISTS
should be used in place of IN.
If the IN performs better in the particular
case, use it. If it doesn't perfom adiquately then, by all means, convert it to
an EXISTS. And do the reverse as well.
I write SQL to answer the given question. If
the question is stated "xxxx is in yyyy" then I code it using an IN. If the
question is stated "process the zzzz that have qqqq" then I code it using an
EXISTS. If the query doesn't perform well, then I convert it to the other
subquery type.
Especially in later versions of O8i and
later Oracle will frequently auto-convert the subquery for you. I've seen it
convert both ways.
Kevin
|
- IN or Exists --- performance issue Munish Bajaj
- Re: IN or Exists --- performance issue rgaffuri
- RE: IN or Exists --- performance issue Mark Leith
- RE: IN or Exists --- performance issue Lord, David - CSG
- RE: IN or Exists --- performance issue Stephane Faroult
- Re: RE: IN or Exists --- performance issue rgaffuri
- Kevin Toepke