SQL Server stored procedure sp_updatestats issue
I have a question about stored procedure sp_updatestats
. My understanding is when upgrading from SQL Server 2000 to SQL Server 2008, we need to execute such procedure, but when upgrading from SQL Server 2005 to S开发者_JAVA百科QL Server 2008, there is no need to execute such stored procedure.
Is my understanding correct? Another question is why from 2000 to 2008 there is need to execute such stored procedure, any reference documents?
thanks in advance, George
As per Randy Minder's answer, I've never done it.
You should have regular index and/or stats maintenance anyway. An index rebuild includes statistics anyway.
You may want to update stats more often though so you'd run sp_updatestats separately. For example, index rebuild as weekends, stats nightly.
Up to date statistics are extremely useful to the query optimiser.
This is not necessary, at least not in my experience. Just get into the habit of regularly rebuilding your indexes and your stats will be updated as well.
精彩评论