Thursday, November 27, 2008

Perfomance Tunning (Update Statement)

How to increase the perfomance for an update statement. Suppose we have a table Tab1 which is having more than 5 crores of records. The user want to update a single column in the table Tab1 using update statement. Now the update statement will take few hours to update the column for all the records.
Hints to improve the performance of the update statement

  • Check the corresponding table is having any triggers, if triggers are found then disable the triggers while updating.
  • Check Is there any constraints for all the columns in the table, if so then make the constraints disable while updating the columns.
  • Check is there any Clustered or Non Clustered Index for the table, if so then drop the indexes while updating and recreate the indexes once you completes the update.

I hope the above hints will helps you to improve the perfomance of an update statement.