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

Home -> Community -> Usenet -> c.d.o.server -> Re: Why this query is SO slow?

Re: Why this query is SO slow?

From: James Williams <willjamu_at_mindspring.com>
Date: Sun, 14 Apr 2002 23:23:55 GMT
Message-ID: <3cba0db2.162044434@nntp.mindspring.com>


On Sun, 14 Apr 2002 23:37:32 +0100, "Max Wilson" <me_at_home.com> wrote:

It would be good if you ran an explain plan to see the access path. The NOT IN will not use an index on ID if one exists.

rewrite your query to be positive

SELECT ID
 FROM pbase
WHERE ID IN (SELECT ID FROM PHASE2 WHERE ID some criteria );

>As subject:
>
>SELECT id
>FROM pbase
>WHERE id NOT IN
>(SELECT id FROM pbase2);
>
>It takes oven an hour to run.
>
>
>Thank you
>Manuel
>
>
>P.S. Sorry if my english not good
>
>
Received on Sun Apr 14 2002 - 18:23:55 CDT

Original text of this message

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