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 -> How to make faster deletion on duplicated records?

How to make faster deletion on duplicated records?

From: <shu_at_openix.com>
Date: 1997/03/06
Message-ID: <5fnbnv$34j$1@spasmolytic.openix.com>#1/1

Hi, all,

I tried the following two ways to delete duplicate records on a 5000 records table:

1).  	DELETE FROM Customer C
	WHERE C.rowid > ( SELECT MIN(X.rowid)
			FROM Customer X
			WHERE X.phone = C.phone);

2).	CREATE TABLE temp
	AS

(SELECT * FROM Customer C
WHERE C.rowid > ( SELECT MIN(X.rowid) FROM Customer X WHERE X.phone = C.phone) ); DROP TABLE Customer; CREATE TABLE Customer AS
(SELECT * FROM temp);
DROP TABLE temp;

The second way is a little faster than the first one, but both of them took about 40 minutes to finish the deletion. Even after I indexed on the "phone" column, the performance is not improved.

Is there any better way to do that? Thanks. Received on Thu Mar 06 1997 - 00:00:00 CST

Original text of this message

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