sql-server-2005 – 如何查找具有statistics_norecompute = ON的索引

我正在寻找一个sql Server 2005查询,它将列出所有索引及其各自的STATISTICS_norECOmpuTE值.我没有在sysindexes中看到任何与该值对应的明显值.

解决方法

该列是 sys.stats中的no_recompute,其中说

Every index will have a corresponding statistics row with the same name and ID (sys.indexes.object_id = sys.stats.object_id AND sys.indexes.index_id = sys.stats.stats_id),but not every statistics row has a corresponding index.

因此,sys.indexes和sys.stats之间的JOIN将匹配您的索引

原因:

>统计信息可以用于列或索引>索引只有一个统计信息.> STATISTICS_norECOmpuTE适用于该索引的统计信息,而不是索引本身

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...