Update Statistics on huge tables - best practice

Published 23 October 07 04:40 AM | SQL Master 

If you have valid indexes and they are maintained with regular schedule of reindexing to address fragmentation, then you can go with UPDATE STATISTICS on the tables that has frequent updates, say once in 2 days during the quiet time on the databases.

During the performance monitoring exercise  you should test by running DBCC FREPROCCACHE and not recommended on the production server though. In any case I would suggest to consider cost as disk IO, Memory, and CPU, among other things. In any case the RUN TIME depends upon the data volume and always it is necessarily as big an issue as the other resources. The faster query may actually use more resources over all, and although it runs faster in test, it may perform slower under peak usage (depending on server's available resources).

Also if the SQL optimizer has no usuable statistics for that column and the column is used in the predicates, then this could result in a poor query plan. In this case you might check for updated statistics plan, slow performance cause the optimizer to choose a suboptimal plan. When in doubt run UPDATE STATISTICS on all tables in the query, preferably WITH FULLSCAN.

Comments

# Other SQL Server Blogs around the Web said on October 23, 2007 5:33 AM:

If you have valid indexes and they are maintained with regular schedule of reindexing to address fragmentation

# SSQA.net - SqlServer-QA.net said on October 23, 2007 5:35 AM:

If you have valid indexes and they are maintained with regular schedule of reindexing to address fragmentation

Anonymous comments are disabled

About SQL Master

**__________________________________** SQL Server MVP, Sr. DBA & industry expert. - Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.

Search

Go

This Blog

«October 2007»
SMTWTFS
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Syndication