Question

When I add an index to a table there is an obvious benefit in searching, however there is also a cost involved with insert/update/delete statements as the index needs to be updated.

If i create a new statistic on a table, does it incur similar costs to an index?

Was it helpful?

Solution

Whatever statistics are being used to find the data for a query will be checked to see if they are up to date. If they are not up to date (based on a random sample) then SQL will update them. If they are not up to date then your query will have a performance hit while it waits for the stats to update.

From what I've found statistics can be set to Auto Update Statistics Asynchronously. This will cause it to use the old statistics for the current query, but tells SQL to update the stats in the background for next time. This could make the current query perform badly if a lot of data has changed.

Main source: MSDN

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top