While it is being updating dating shorter guy

To be perfectly clear: if you’re a system administrator and want to update statistics, I’d rather you use this approach than nothing at all.Presumably, if you don’t have a full-time DBA, you also don’t need the system to be available 24×7, so you can take the performance hit at night or on the weekend while all statistics update. But, if you are a DBA and you know how to write T-SQL, then you can absolutely write some code that programmatically looks at your statistics and decides what to update and what to skip.

If I let SQL Server update statistics automatically, I would need 400,500 rows to change.

It’s quite possible that with a table of that size I would want to statistics to update sooner – say after 200,000 rows had changed, or 10% of the table.

The sp_updatestats command will only update statistics if data has changed.

That sounds good, but the caveat is that only one (1) row has to have changed.

Ultimately, when it comes to scheduled updates of statistics, you can go the sledgehammer route (Update Statistics task or sp_updatestats) or the selective update route (UPDATE STATISTICS and sys.dm_db_stats_properties).

Using the Update Statistics task or sp_updatestats is easier if you’re not familiar with SQL Server and if you have the maintenance window and resources for it to run.

Therefore, some of your indexes will rebuild (and thus have statistics updated) and some will not (and not have updated statistics).

How do you manage that with the Update Statistics task?

Therefore, there is no need to update Index statistics after you rebuild all your indexes, but you do need to update column statistics. The Rebuild Index task has more options in SQL Server 2016, which is nice for that specific task, but it makes providing guidance about statistics updates a bit trickier.

Tags: , ,