Re: Why does NOT IT take so long

From: Jim Smith <Jim_at_jimsmith.demon.co.uk>
Date: 1995/07/23
Message-ID: <806530334snz_at_jimsmith.demon.co.uk>#1/1


In article <3uu80q$2nj_at_explorer.csc.com> tconder_at_csc.com "Tom Conder" writes:

> When writing Oracle SQL, why does the NOT IN statement take so long?
>
>
> --
> Tom Conder
> tconder_at_csc.com
>
I assume you mean something like

... where this_id not in

   (select other_id from other table...)

It has to process the entire sub-query. Depending on other parts of your query it may process the sub-query once for each row returned by the outer query.

The performance of the subq-query will depend on its where clause (if any) and on whether or not the query can use an index

-- 
Jim Smith
Received on Sun Jul 23 1995 - 00:00:00 CEST

Original text of this message