• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 39
  • Last Modified:

statistics before and after huge DEL/INS

is there a good procedure recommended to do after a BIG DEL/INS operation to make sure stats are not out of hand?
0
25112
Asked:
25112
2 Solutions
 
Pawan KumarDatabase ExpertCommented:
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
 
Megan BrooksSQL Server ConsultantCommented:
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
 
25112Author Commented:
thanks for both angels of inputs..

can you suggest what is a stats freshness test and what (all) does it involve?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now