我有一个来自NET的面试问题,但没有找到正确的解决方案,任何人都可以告诉 我这个查询有什么问题?关于索引的SQL服务器访问查询?
鉴于此表结构和索引,后续查询有什么问题?
CREATE TABLE dbo.IndexQ (
ID int IDENTITY(1, 1) NOT NULL,
TestBit bit NOT NULL
)
GO
CREATE NONCLUSTERED INEX IX_IndexQ_TestBit ON dbo.IndexQ (TestBit)
GO
* Insert some rows where some bits are 0 and some are 1...
SELECT *
FROM dbo.IndexQ
WHERE TestBit = 1
* What's the problem with this query?
在附注中,它对低基数列具有'index'效率不高 – praveen 2013-04-08 09:20:04