我有以下表格和内容
create table t(i int primary key, j int, k char(6000))
create index ix on t(j)
insert into t values(1,1,1)
insert into t values(2,1,1)
insert into t values(3,1,1)
insert into t values(4,1,1)
insert into t values(5,1,1)
insert into t values(6,1,1)
insert into t values(7,1,1)
insert into t values(8,2,2)
insert into t values(9,2,2)
select * from t where j = 1
select * from t where j = 2
Run Code Online (Sandbox Code Playgroud)
我真的很困惑为什么第一个 SELECT 只使用Clustered Index Scan (Clustered)而第二个使用Index Seek (NonClustered)和 …