views:

66

answers:

1

After a few years, one of my largest databases has accumulated 73 statistics on one of it's largest tables.

With indexes, I can run many types of reports and queries to decide how often / heavily specific indexes are used. Is there an equivalent for statistics? How can I tell which ones are useless after all these years?

We're running SQL 2005.

+1  A: 

Statistics are automatically managed and to be honest I'm not aware of any management except the "UPDATE STATISTICS", "CREATE STATISTICS" and "DROP STATISTICS" commands. In theory UPDATE should handle the addition and removal of statistical data. Additionally, I have never heard of the statistics taking up terribly large amounts of storage or memory, so I'm not sure if there is any reason for alarm.

If you are seeing a potential problem, I would suggest running an update first. If that doesn't clean it up, dropping and then creating would seem to be a safe operation (as they are only for the query optimizer). I wouldn't leave them "dropped" in production however as bad optimizations would be worse than a handful of leftovers from the table's history.

Godeke