Bill, Try this:
Delete >From T1 Where F1 In ( Select F1 From T1 Minus Select PK From T2 ); This will delete T1 rows for which there's no matching PK in T2 and will most likely be quicker than the Not Exists query, though you never can say for sure! ;-) Oh, and the Cost that Explain Plan reports is purely relative and can't be used for comparison across different queries. Jack -------------------------------- Jack C. Applewhite Database Administrator/Developer OCP Oracle8 DBA iNetProfit, Inc. Austin, Texas www.iNetProfit.com [EMAIL PROTECTED] (512)327-9068 -----Original Message----- Bill Sent: Thursday, February 28, 2002 3:24 PM To: Multiple recipients of list ORACLE-L I have a query that deletes rows from a table with 57K rows, as follows delete from T1 where not exists (select T2.PK from T2 where T2.PK = T1.F1); T2.PK is the Primary Key on Table T2 T1.F1 is an indexed field on table T1 Explain plan shows a low cost (80) but the delete takes about 10+ minutes. T1 has about 57K rows T2 has about 29500 rows other queries with costs in the 700 range are pretty quick - this one's a dog any ideas? thanks Bill Magaliff Framework, Inc. 914-631-2322 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jack C. Applewhite INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).