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 -> Re: HELP- Insert/Update Sloooow

Re: HELP- Insert/Update Sloooow

From: Access <idmwarpzone_NOSPAM__at_yahoo.com>
Date: Wed, 5 Jan 2005 19:32:18 +0100
Message-ID: <41dc32ba$0$2761$ba620e4c@news.skynet.be>

<hliji_at_yahoo.com> wrote in message
news:1104933195.607291.274660_at_z14g2000cwz.googlegroups.com...
> Hi,
>
> I have 2 tables, working table W and the history table H.
> W has 2 million rows. I need to compare a common column C
> in both tables. For a record in W, R, if R.C has a value that
> equals to a record's H.C in H, then update that record in H.
> Otherwise, R is considered a new record for H and will be inserted
> into H.
>
> I used a cursor for loop for W. But the operation was extreamly
> slow. Any other solutions?
>
> Thanks in advance.
>
> MK
>

Have you checked with sqltrace/tkprof where the bottleneck is ? Do you have any indexes on the table ? Maybe for each comparison, a full-table scan is done ...

Matthias Received on Wed Jan 05 2005 - 12:32:18 CST

Original text of this message

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