Note that since an index rebuild operation recreates the index, SQL Server will also update the index Statistics object.
The next step is to copy this text, paste it into a query window in SQL Server Management Studio, then execute it against the instance.
Alternately you may choose only to execute it against select databases, but that is entirely up to you.
The optimizer obtains its knowledge of the data, its distribution, and the number of rows a given query is likely to return from the available statistics.
Based on this knowledge, it decides the optimal access path, making choices such as whether to scan a table or perform an index seek, use a nested loop join or a hash join, and so on.
If you're like me, you have a SQL Agent job in place to rebuild or reorganize only the indexes in your databases that truly require such actions.
If you rely on the standard maintenance plans in Microsoft SQL Server, a policy of rebuilding all indexes occurs.How do you find out if statistics are correct, and what can you do if the automatic update of statistics isn't right for the way a table is used?Statistics are critical metadata used by SQL Server’s query optimizer, which influence the selected execution plan for a query.If statistics are out of date, or do not exist, the optimizer can make poor choices and execution plan quality, and consequently query performance, can suffer.SQL Server can automatically maintain statistics, periodically refreshing them based on its tracking of data modifications.I’ll then explain, in more detail, why automatic updates to statistics may not be sufficient, and what data you can gather and monitor to help you manage statistics manually, and proactively, rather than in response to query performance issues.