Re: Advanced SQL question: NOT EXISTS

From: Grant Donohoe <grant_at_abbi.demon.co.uk>
Date: 1995/05/25
Message-ID: <801432707snz_at_abbi.demon.co.uk>#1/1


In article <3q12vf$rmt_at_newsbf02.news.aol.com>

           vincen5158_at_aol.com "Vincen5158" writes:

> >>
> NOT EXISTS isn't a good choice -- for anything. It's very inefficient.
> (If you think about it, you'll
> realize that it requires that the ENTIRE table be checked for the value.)
> That being said, I'm not
> sure that NOT EXISTS is a good choice for what you're attempting to
> accomplish, either
> >>
> For the RULE based optimization I've found just the opposite, EXISTS is
> much quicker than IN. Its the IN clause that essentially has to create a
> complete result set (after all IN compares against a list) each time to
> satisify the query. EXISTS determines whether the condition is true and
> uses indexes to satisfy it. I'd be interested in your experiences on this.
>
What if it finds a matching value immediately, I think it then stops, unlike not in ? Thus NOT EXISTS is faster if you expect to find something.

Am I right ...

-- 
Grant Donohoe
Oracle Contractor (Believe it or not !)
Reigate
Surrey
U.K
grant_at_abbi.demon.co.uk
Received on Thu May 25 1995 - 00:00:00 CEST

Original text of this message