RE: Simple SQL Query

From: Blanchard, William <wblanchard_at_societyinsurance.com>
Date: Thu, 7 Jan 2010 11:28:13 -0600
Message-ID: <CB340D772D072D47A5DE07533432A7E50E26E2A3_at_exch1.soc.int>



Two suggestions, indexes and minus.

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Pani Babu Sent: Thursday, January 07, 2010 11:04 AM To: oracle-l_at_freelists.org
Subject: Simple SQL Query

I have a simple SQL query which lists all the records that are not in a second table.

select first.id from first
where first.id not in (select id from second);

As the second table is very huge, it takes a very long to process the query.
Is there a way to rewrite the query to run it quicker?

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 07 2010 - 11:28:13 CST

Original text of this message