为什么 SQL Server 2005 动态管理视图报告缺失的索引,而实际上却没有? [英] Why does SQL Server 2005 Dynamic Management View report a missing index when it is not?

查看:25
本文介绍了为什么 SQL Server 2005 动态管理视图报告缺失的索引,而实际上却没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SQL Server 2005 和动态管理视图 sys.dm_db_missing_index_details.它继续告诉我 Table1 确实需要在 ColumnX 和 ColumnY 上建立索引,但该索引已经存在!我什至删除并重新创建了几次都无济于事.

I'm using SQL Server 2005 and the the Dynamic Management View sys.dm_db_missing_index_details. It continues to tell me that Table1 really needs an index on ColumnX and ColumnY, but that index already exists! I've even dropped and re-created it a couple times to no avail.

更多细节:该视图在 equality_columns 下列出了 Column1.Column2 列在 inequality_columns 下,所以我创建的索引是:

More specifics: The view lists Column1 under equality_columns. Column2 is listed under inequality_columns, so the index I have created is:

create index IndexA on Table1 (Column1 asc, Column2 asc)

这不正是 sys.dm_db_missing_index_details 告诉我我需要的索引吗?

Isn't this exactly the index sys.dm_db_missing_index_details is telling me I need?

推荐答案

随机想法:如果将其中一列声明为DESC"会怎样?

Random thought: What if one of the columns is better declared "DESC"?

这对 ORDER BY 子句很有用,我已经看到逻辑 IO 减少了一半.

This is useful for ORDER BY clauses and I've seen logical IO reduce by half.

这篇关于为什么 SQL Server 2005 动态管理视图报告缺失的索引,而实际上却没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆