Solved

statistics before and after huge DEL/INS

Posted on 2016-10-06
3
14 Views
Last Modified: 2016-10-31
is there a good procedure recommended to do after a BIG DEL/INS operation to make sure stats are not out of hand?
0
Comment
Question by:25112
3 Comments
 
LVL 17

Accepted Solution

by:
Pawan Kumar Khowal earned 250 total points
Comment Utility
In that case you should update your stats on daily basis (Only on the tables it is needed)  in the night when users are office.

Update Statistics tableName...
0
 
LVL 13

Assisted Solution

by:Megan Brooks
Megan Brooks earned 250 total points
Comment Utility
If you have very large tables, you should turn on trace flag 2731 (after testing), if you have SQL Server 2008 R2 SP1 or later.  SQL Server 2016 (finally) turns it on by default. If all you have is a one-time delete/insert, or an earlier version of SQL Server, you can update stats as noted.

I would do some research before setting up a job to update stats daily. If you have idle time during off hours for running maintenance tasks, and testing shows that updating stats daily works better than not doing it, it might be OK.

Personally, in either case (one-time or scheduled), I would do stats freshness tests first to see if stats updates were likely to be an issue, and how often they needed to be updated, and to confirm that freshness actually improves afterward. If you set up a daily job and forget about it, and it isn't really necessary, and if the server workload changes, you could be in for problems.
0
 
LVL 5

Author Comment

by:25112
Comment Utility
thanks for both angels of inputs..

can you suggest what is a stats freshness test and what (all) does it involve?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now