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

Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL statement is taking too long

Simple SQL statement is taking too long

From: Atif Ahmad Khan <aak2_at_Ra.MsState.Edu>
Date: 1997/04/20
Message-ID: <5jcmmk$bl5$1@NNTP.MsState.Edu>#1/1

I am trying the following simple SQL statement and it takes way too long. Infact I have always terminated it after waiting for 15 minutes.

delete from table1 where product not in
(select a.product from table1 a , table2 b where a.product = b.product and b.price < 200 )

table1 has 900 records and table2 has about 60,000, both are keyed on product and have no other indexes. The subquery returns 700 records. Just executing the subquery takes less than 5 sconds. I am not sure why it is taking so long to delete 200 records. Maybe my logic is flawed ?

Any ideas ?

Atif Khan
aak2_at_ra.msstate.edu Received on Sun Apr 20 1997 - 00:00:00 CDT

Original text of this message

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