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 -> Removing duplicated rows revisited - I'm feeln' mighty lame

Removing duplicated rows revisited - I'm feeln' mighty lame

From: Boyce G. Williams, Jr. <bgwillia_at_vcu.edu>
Date: Tue, 16 Mar 1999 15:21:57 GMT
Message-ID: <36ee69fc.4304658@usenet.acw.vcu.edu>


Hi,

I found a table where there is a lot of duplicated telephone calls in it. To be more precise: 34,000 duplicate calls from a table containing 1.5 million rows. Some were posted the same day as its duplicate, others were posted on different days. I wrote a series of queries to extract the first posted call of a duplicated set, delete all the duplicated calls, then reinsert the first call back in. My concern is the actual delete step: it uses a correlated subquery. Previous experience with our machine (a RS/6000 running Oracle) showed me it has a hard time working with correlated subqueries of any kind. At one point I ran a SELECT correlated subquery for six hours without it ever completing. When I broke up the query into two, the inner query being a VIEW and the outer query being a SELECT based on the VIEW, it took two hours and completed. Go figure.

I'm presenting what I'm planning to do in the hopes someone may give advice on improving it. I'm mainly concerned about the DELETE step since every source I've found on deleting rows from one table based on another uses the correlated subquery method. Maybe someone knows a better way...

--

Thanks in advance,
Boyce G. Williams, Jr.
Boyce G. Williams, Jr.

 .--------------------------------------------------------------------.
 | "People should have two virtues:  purpose- the courage to envisage |
 | and pursue valued goals uninhibited by the defeat of infantile     |
 | fantasies, by guilt and the failing fear punishment;  and wisdom- a|
 | detached concern with life itself, in the face of death itself."   |
 |                                                     Norman F. Dixon|
 '--------------------------------------------------------------------'
Received on Tue Mar 16 1999 - 09:21:57 CST

Original text of this message

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