Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL statement is taking too long
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