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: Richard Piasecki <ogo_at_mailcity.com>
Date: 14 Apr 2002 18:07:08 -0500
Message-ID: <292kbugmf1u361r5e5du7copm51tafpr0e@4ax.com>


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

>As subject:
>
>SELECT id
>FROM pbase
>WHERE id NOT IN
>(SELECT id FROM pbase2);
>
>It takes oven an hour to run.
>

Try re-writing it with an outer join..

select a.id from pbase a, pbase2 b
where a.id = b.id(+) and b.id is null;

It looks a little bizarre, but it should work. 'IN' clauses are quite slow.

>
>Thank you
>Manuel
>
>
>P.S. Sorry if my english not good
>
Received on Sun Apr 14 2002 - 18:07:08 CDT

Original text of this message

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