Re: Advanced SQL question: NOT EXISTS
From: Vincen5158 <vincen5158_at_aol.com>
Date: 1995/05/25
Message-ID: <3q12vf$rmt_at_newsbf02.news.aol.com>#1/1
Date: 1995/05/25
Message-ID: <3q12vf$rmt_at_newsbf02.news.aol.com>#1/1
>>
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.
Received on Thu May 25 1995 - 00:00:00 CEST