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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Long running SQL Problem?

RE: Long running SQL Problem?

From: CHAN Chor Ling Catherine (CSC) <clchan_at_nie.edu.sg>
Date: Wed, 27 Mar 2002 01:48:24 -0800
Message-ID: <F001.004347E6.20020327014824@fatcity.com>


Hi Denham,  

Suggestion 1) Perhaps you may create an index for table_1 (col1,col2) and table_2 (col3,col4)
Suggestion 2) Try

                        SELECT col1,col2 
                        FROM Table_1 
                        WHERE (0=(select count(*) from table_2 where
col3=col1 and col4=col2))  

Hope it helps.  

Regds,
Catherine

-----Original Message-----
Sent: Wednesday, March 27, 2002 4:53 PM
To: Multiple recipients of list ORACLE-L

Hello List

Is there anyone who can give me a solution to this problem. It is a sql that runs forever and I eventually have to kill it, both tables are large 500000 + rows.
Is there perhaps a quicker more effecient way of doing this.

SELECT col1,col2
FROM Table_1
WHERE (col1,col2) NOT IN (SELECT col3,col4 FROM Table_2);

TIA
Denham Eva
Oracle DBA


This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal - For more information please visit <http://www.marshalsoftware.com> www.marshalsoftware.com


--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: CHAN Chor Ling Catherine (CSC)
  INET: clchan_at_nie.edu.sg

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Mar 27 2002 - 03:48:24 CST

Original text of this message

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