View Single Post

   
  #3 (permalink)  
Old 02-28-2008, 06:33 PM
Asger Jensen
 
Posts: n/a
Default Re: Fastest way of updating a row

> I'm not sure that I follow, but it sounds to me that the in first
> approach you would retrieve rows one by one.


Yes, thats what it was. Nasty.
>
> In any case, the second approach leaves all the jub to the computer,
> and there is a reason why we have computers, isn't there? :-)
>

:-), yes, only in my scenario it took soooo long.

> The only catch is that with too many rows in the table there can be
> a strain on the transaction log. But with only 70000 rows, this is
> not worth worrying about.
>


ok,

> Obviously there query will run faster if there is a clustered index
> on the column "key".

There was, actually, but during the 70000 records it became slower and
slower. I solved it by adding a dynamically generated index on ALL
fields, not just "key", this sped things up considerably, so I went
from 1 hour to 10 minutes.

I guess it is due to the server needing to do a lookup/record on all
value fields to see if they have changed, and this can be done more
efficiently with a n index.

Regards
Asger
Reply With Quote