I have a simple update statement I need to run on a large table of about 20 million records. The update itself takes about 11 minutes to run. I ran the update in batches of 50,000 at a time and that knocked it down to about 9 minutes. Is there anything that can be done to improve this further? I really need it to run much quicker. I am concatenating a Varchar field with a text field. OldValue is the TEXT field update TableA set NewLong = OldValue+cast(NewLong as varchar(max)) where OldValue''
Because the old value is going for something other than empty string, there's not much you can do with indexes to make it faster. I think you've largely covered what's possible unless you have a better way to filter that can use an index to speed up the process.