I have "auto create statistics" turned on. Many of my tables seem to have dozens of statistics associated with them. I believe many of them are old and no longer used. Can I delete all of the statistics that result from this query...SELECT o.id, case when INDEXPROPERTY(i.id, i.name, 'IsStatistics') = 1 then 'drop statistics [' else 'drop index [' end + OBJECT_NAME(i.id) + '].[' + i.name + ']'FROM sysindexes i join sysobjects o on i.id = o.idWHERE (INDEXPROPERTY(i.id, i.name, 'IsHypothetical') = 1 OR(INDEXPROPERTY(i.id, i.name, 'IsStatistics') = 1 ANDINDEXPROPERTY(i.id, i.name, 'IsAutoStatistics') = 0))
The presence of hundreds of unused statistics probably causes my daily "update statistics" to take longer than it needs to.Is it supposed to be a 1 to 1 relationship between indexes and statistics?