sql-server - SQL 服务器 : Key Lookup without Clustered Index

标签 sql-server database indexing clustered-index non-clustered-index

我有一个名为 Scan 的表,它只有两列:id (int)a (char)

它开始时没有任何索引。所以我在下面创建了一个非聚集索引链接

CREATE INDEX ix_id ON scan(id ASC)

所以我运行了这个选择:

SELECT id, a
FROM Scan
WHERE id = 1

这是执行计划:

enter image description here

如果我的表没有任何聚集索引,为什么我会得到一个键查找(聚集)?

最佳答案

Why did I get a Key Lookup (clustered) if my table doesn't have any clustered index?

你没有。这大概是 html-query-plan 中的错误SQL Operations Studio 使用的库。

Paste The Plan 网站 (example) 上也出现了同样的问题。

如您所知(因为您找到了!)错误报告 is here .

关于sql-server - SQL 服务器 : Key Lookup without Clustered Index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48328160/

相关文章:

Laravel Eloquent 查询 200 万行需要很长时间

python - Unix 目录结构的快速、逐行 "grep -n"等价物

database - 如何标识需要创建哪些索引

sql-server - 尝试更改 SQL Server IP 设置。配置管理器告诉我 "The specified file is read only"

c++ - 在 SELECT 中拆分一个 varbinary

SQL Server 舍入错误,给出不同的值

database - 如何在数据库中表示二维数据矩阵

java - 将 Java 8 与 Access 连接时出错 : No suitable driver found

sql-server - CRM 2011 Silverlight 存储过程

mysql - 需要MySQL查询多对多映射计数记录