If you absolutely must update the statistics and rebuild the indexes and you’re not going to try to tightly control exactly which indexes and tables you do this on, then the best practice would be to update the statistics first and then rebuild the indexes second. The keyword and tricky phrase that you have to look at is WITH FULL SCAN.That indicates that the full data set is used to create/update the statistics.Now when you reorganize an index, no modifications of any kind are made to the statistics.So if you’ve had enough modifications to the data that you feel you should also update the statistics, go ahead and do it for indexes that you’ve reorganized because you won’t be hurting any other work.
SQL Server provides two basic commands to help you to maintain your statistics, sp_updatestats and UPDATE STATISTICS.
They’re created at different points and, unless you’re creating the statistics manually yourself, they’re created slightly differently.
The statistics on an index are created with the index.
You can look at the header using DBCC SHOW_STATISTICS. They’re also sampled and automated to update on the criteria that we outlined in the first question.
This contains a bunch of general information about the statistics in question. Address table: As you can see, the last time the statistics were updated was January 4, 2013 at AM. If the data in your system is fairly well distributed, as is usually the case, then the sampled statistics will work well for you.