我有一个名为 Scan
的表,它只有两列:id (int)
和 a (char)
。
它开始时没有任何索引。所以我在下面创建了一个非聚集索引链接
CREATE INDEX ix_id ON scan(id ASC)
所以我运行了这个选择:
SELECT id, a
FROM Scan
WHERE id = 1
这是执行计划:
如果我的表没有任何聚集索引,为什么我会得到一个键查找(聚集)?
最佳答案
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/