I just ran a T-SQL query through DTA and one of the recommendations is to CREATE STATISTICS on one of the columns that is part of many of the queries in the SQL code file.
My question is, how exactly do statistics aid in performance?
|
I just ran a T-SQL query through DTA and one of the recommendations is to CREATE STATISTICS on one of the columns that is part of many of the queries in the SQL code file. My question is, how exactly do statistics aid in performance? |
|||
|
|
|
statistics is used when query execution plan created.
See http://msdn.microsoft.com/en-us/library/ms190397.aspx for more details. |
|||||||||||
|
|
If DTA recommended a single column statistic, you must have auto create stats turned off? Auto create will build stats on any column used in a predicate, automatically, so generally its a good idea to leave it switched on. Check the status of auto update for this database, which again should usually be on. One of the best uses of DTA is for identifying missing multi-column statistics, which auto create won't build. But for single column, auto create should be taking care of them for you. |
|||
|
|