Updating Statistics

Statistics and sql server. When people ask me what are statistics I answer with a Google maps analogy: while we know the roads are there, the traffic changes and, therefore, in the same way we know it is best to patiently wait for the traffic to get updated before choose what route to take, we have to give sql server a way to keep up with the data present in the tables. I choose to have all statistics updated at a fixed time – 7 pm actually – unless there are large loads overnight. If that is the case then the job runs after the loads.

This is the sql I use for updating statistics. As you can see, it does reference other objects and while I’ll eventually get to sharing, it won’t run properly without them. Why a custom procedure? Check out what these smart people say:

  1. www.scarydba.com
  2. www.sqlshack.com
  3. www.brentozar.com
  4. etc…

What I got from these posts is don’t run the default procedure because it’ll reread your data and items will get updated which don’t need attention. That sounds inefficient. What I also wanted was logging to see what was requiring updates and avoid blocking. I include an input parameter to give the count of objects requiring updates in case I am curious.

This entry was posted in Configuration, DBA, SQL. Bookmark the permalink.

2 Responses to Updating Statistics

  1. Toni says:

    of an crash are a lot a lot more undesirable. Children needs to be coeahcd to own sun shades accurate early on merely simply because they will learn to carry a set of sun shades whenever they go out. You’re not merely guarding their delicate eyes, but moreover instructing all of these that sun shades are important. Guarding his or her face may possibly also reduce the chance of consideration infections. Truly toddlers have to be put in the habit of smoking associated with enhancing sun glasses. They appear truly lovely and they are also generated for a specified

Leave a Reply to paulwinans Cancel reply

Your email address will not be published. Required fields are marked *