22,297
社区成员




/*
表中记录Rows:40846773
字段SN:nonclustered, unique, primary key located on PRIMARY
*/
set statistics IO on
declare @SN varchar(20)='ABCDEFGH'
select * from TB where SN=@SN
set statistics IO off
--扫描计数 0,逻辑读取 7 次,物理读取 0 次,预读 0 次,lob 逻辑读取 0 次,lob 物理读取 0 次,lob 预读 0 次。
set statistics IO on
declare @SN1 nvarchar(20)='ABCDEFGH'
select * from TB where SN=@SN1
set statistics IO on
--扫描计数 1,逻辑读取 6346 次,物理读取 0 次,预读 0 次,lob 逻辑读取 0 次,lob 物理读取 0 次,lob 预读 0 次
set statistics IO on
declare @SN nvarchar(20)='ABCDEFGH'
exec ('select * from tb where name=''@SN''')
set statistics IO off
set statistics IO on
declare @SN varchar(20)='ABCDEFGH'
select * from csdnscore where r=@SN
set statistics IO off
go
set statistics IO on
declare @SN nvarchar(20)='ABCDEFGH'
select * from csdnscore where r=@SN
set statistics IO off
/*
(0 行受影响)
表 'csdnscore'。扫描计数 1,逻辑读取 157 次,物理读取 0 次,预读 0 次,lob 逻辑读取 0 次,lob 物理读取 0 次,lob 预读 0 次。
(0 行受影响)
表 'csdnscore'。扫描计数 1,逻辑读取 157 次,物理读取 0 次,预读 0 次,lob 逻辑读取 0 次,lob 物理读取 0 次,lob 预读 0 次。
*/