Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Updating covering Index Expand / Collapse
Author
Message
Posted Wednesday, March 27, 2013 7:18 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, October 3, 2014 2:37 AM
Points: 91, Visits: 213
Dear All,

I have a covering index Idx1 on Col1 included Col2 and Col3.

My question is if i run the following statement
update tbl1 set col2=anyvalue

will that update statement trigger an update on Idx1 or not?.

I am asking that because i have a big table with a column included in many indexes and i am afraid that could have an impact on performance when executing update statements on that included column.

Thanks in advance.

Nader
Post #1435892
Posted Wednesday, March 27, 2013 7:37 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, October 31, 2014 10:27 AM
Points: 708, Visits: 3,293
nadersam (3/27/2013)
will that update statement trigger an update on Idx1 or not?.


Yes, I'm afraid it will.

nadersam (3/27/2013)
I am asking that because i have a big table with a column included in many indexes and i am afraid that could have an impact on performance when executing update statements on that included column.


You may want to disable the indexes, perform your update then enable them again and perform index rebuilds.



---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1435904
Posted Wednesday, March 27, 2013 7:49 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:14 PM
Points: 40,615, Visits: 37,081
nadersam (3/27/2013)
I am asking that because i have a big table with a column included in many indexes and i am afraid that could have an impact on performance when executing update statements on that included column.


Have an effect, yes. Have a severe one, you need to test to see. Unless you're doing several updates in a row it probably won't be worth disabling all the indexes and rebuilding them after as the rebuild itself will take quite some time, plus you'll have the log impacts for all those rebuilds. Test though, see which is faster overall.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1435913
Posted Wednesday, March 27, 2013 8:02 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, October 31, 2014 10:27 AM
Points: 708, Visits: 3,293
I had a similar issue last week with a table of 80 million+ rows which had several indexes with included columns. But now I remember I had to perform several updates which basically took far too long. In the end I took the decision to disable the indexes before running my updates.
As has been suggested you can try it with indexes and (without + index rebuilds) but either way is going to cost you time.

However, if you're going to be doing this again in future, at least you'll know which option will take less time.


---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1435918
Posted Wednesday, March 27, 2013 8:05 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, October 3, 2014 2:37 AM
Points: 91, Visits: 213
Thanks for you reply
Post #1435921
Posted Wednesday, March 27, 2013 8:08 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, October 3, 2014 2:37 AM
Points: 91, Visits: 213
Dear Abu Dina and GilaMonster thanks very much for you replies
Post #1435922
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse