0

我安装了 SQL Server 2008 R2(少数几个),它是相当繁忙的系统。我正在尝试通过使用缺失索引表中的信息来优化一些索引,就像我过去所做的那样。

奇怪的是sys.dm_db_missing_index_group_stats那张桌子是空的?!

现在我不相信该服务器上的所有数据库都不会错过任何一个节拍,并且其他表(如sys.dm_db_missing_index_group_stats,sys.dm_db_missing_index_group_stats等)包含大量记录。

刚才我看到该表中短暂出现了 1(一)条记录,从那时起它就消失了。

我想知道该服务器是否有严重问题,或者我是否遗漏了一个小问题

4

1 回答 1

1

似乎是 SQL 2008 R2 中的一个错误。在谷歌搜索“sys.dm_db_missing_index_group_stats empty”(向 Mike West 致敬)。

我会试着解释会发生什么。

SQL Server 的缺失索引功能中使用了 4 个 DMO(动态管理对象)。
缺失的索引详细信息保存在这些 DMO 中,直到被清除。当您实际创建缺少的索引(或重新启动服务器)时会触发清除。

但是,这些 DMO 中最多可以保存 600 行。

这与 sys.dm_db_missing_index_group_stats DMO 仅为已执行查询收集数据这一事实相结合,而其他三个为已编译和已执行查询收集数据会引入此“错误”。

The workaround suggests that the sys.dm_db_missing_index_details dmv be queried and all suggested indexes be created with "STATISTICS_ONLY = -1" and then dropped. This would restart the index recommendations gathering.

More explanation here, and a workaround here.

于 2016-06-18T20:26:31.930 回答