
statistics


Does Truncate Table Reset Statistics?
Short answer: the SQL Server optimizer will know that the table was truncated, but statistics might not update when you expect.
For the long answer, let’s walk through an example using the WideWorldImporters sample database.

When Did SQL Server Last Update That Statistic? How Much Has Been Modified Since? And What Columns are in the Stat?
Whether I’m working as a DBA, a consultant, a teacher, or just answering questions in my inbox, I always end up needing a script to inspect statistics one way or another.
Here are some freshly written scripts for a classic DBA question: what’s going on in my stats?

Can I Use Statistics to Design Indexes? (Dear SQL DBA Episode 18)

Managing Statistics in SQL Server for DBAs (videos)
Want to learn more about managing statistics updates in SQL Server? Watch my 27 minute presentation on managing statistics.

Updating Statistics in SQL Server: Maintenance Questions & Answers
I’ve been asked a lot of questions about updating statistics in SQL Server over the years. And I’ve asked a lot of questions myself! Here’s a rundown of all the practical questions that I tend to get about how to maintain these in SQL Server.

Free Webcast! Updating Statistics in SQL Server: Questions and Answers
What are statistics? How often should you update them? Do you need a trace flag to make this easier? What are duplicate statistics, and do you need to drop them?
Join me for a live Hangout on Monday, April 18 at 8:30 AM Pacific / 11:30 AM Eastern to up your maintenance game!

How Stale are my Statistics?
Update: improved/more recent version of queries for this are here.
It can be pretty difficult to manage statistics in data warehouses, or even OLTP databases that have very large tables.