由于a Table Scan和a Clustered Index Scan本质上都扫描了表中的所有记录,为什么Clustered Index Scan应该更好?
举个例子 - 当有很多记录时,下列内容之间的性能差异是什么?:
declare @temp table(
SomeColumn varchar(50)
)
insert into @temp
select 'SomeVal'
select * from @temp
-----------------------------
declare @temp table(
RowID int not null identity(1,1) primary key,
SomeColumn varchar(50)
)
insert into @temp
select 'SomeVal'
select * from @temp
Run Code Online (Sandbox Code Playgroud)