Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: EXISTS/NOT EXISTS vs. IN/NOT IN

Re: EXISTS/NOT EXISTS vs. IN/NOT IN

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 28 Mar 2000 19:57:46 +0800
Message-ID: <38E09E3A.6CCA@yahoo.com>


emreed1234_at_my-deja.com wrote:
>
> I've read there are two advantages of EXISTS. One is that EXISTS can
> perform faster than IN under certain circumstances. The other
> advantage I've heard is that there are some queries that cannot be done
> with IN, but can be done with EXISTS.
>
> Could someone post the reasoning behind performance gains?
>
> Could someone also post a good example of when only EXISTS will work?
>
> Thanks!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

This is somewhat of a generalisation - in the "ol days" NOT IN typically ran like a dog. In later releases, the NOT IN performance has improved (ie used similar access paths to NOT EXISTS).

Similarly with IN and EXISTS - although are often (not always) better expressed as a join (predominantly to yield the newer and generally faster) HASH join plan.

HTH
--



Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse Received on Tue Mar 28 2000 - 05:57:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US