我从 NET 收到了一个面试问题,但没有找到合适的解决方案,谁能告诉我这个查询有什么问题?
给定这个表结构和索引,后续查询有什么问题呢?
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?