View Single Post

   
  #5 (permalink)  
Old 02-29-2008, 03:00 AM
Muzamil
 
Posts: n/a
Default Re: Performance Tuning for Row-by-Row Update Statement

Hi
Thanks for your reply.

The row-by-row update is mandatory becuase the leagacy system is
sending us the information such as "Add", "Modify" or "delete" and
this information HAS to be processed in the same order otherwise we'll
get the erroneous data.
I know it's a dumb way of doing things but this is what our and their
IT department has chosen to be correct way of action after several
meetings. Hence the batch idea will not work here.


I am not using Cursors, instead I am using the loop based on the
primary key.

The log files are on different drives.

I've also tried using "WITH (ROWLOCK)" in the update statement but
it's not helping much.

Can you please still throw in some idea? Would be great help!

Thanks


"Greg D. Moore \(Strider\)" <mooregr_deleteth1s@greenms.com> wrote in message news:<tOxrc.234090$M3.65389@twister.nyroc.rr.com>. ..
> "Muzamil" <muzamil@hotmail.com> wrote in message
> news:5a998f78.0405211023.24b40513@posting.google.c om...
> > hi
> >
> > For an unavoidable reason, I have to use row-by-row processing
> > (update) on a temporary table to update a history table every day.
> > I have around 60,000 records in temporary table and about 2 million in
> > the history table.

>
> Not much you can do if you absolutely HAVE to do row-by-row updating.
>
> You might want to post DDL, etc. so others can take a crack at it. I've
> seen many times someone will say, "I have to use a cursor", "I have to
> update one row at a time" and then someone posts a much better/faster
> solution.
>
> Also, how are you handling transactions? Explicitly or implicitely? If
> you're doing them implicitely, are you wrapping each update in its own, or
> can up batch say 20 updates?
>
> Finally, where's your log files? Separate physical drives?
>
>
> >
> > Could any one please suggest different methods to imporve the runtime
> > of the query?
> >
> > Would highly appreciate!

Reply With Quote