Sql server一些常见性能问题的总结~
select id from t where num is null
select id from t where num=0
select id from t where num=10 or num=20
select id from t where num=10
union all
select id from t where num=20
select id from t where num in(1,2,3)
select id from t where num between 1 and 3
select id from t where name like '%abc%'
select id from t where num=@num
select id from t with(index(索引名)) where num=@num
select id from t where num/2=100
select id from t where num=100*2
select id from t where substring(name,1,3)='abc'--name以abc开头的id
select id from t where datediff(day,createdate,'2005-11-30')=0--‘2005-11-30’生成的id
select id from t where name like 'abc%'
select id from t where createdate>='2005-11-30' and createdate<'2005-12-1'
select col1,col2 into #t from t where 1=0
create table #t(...)
select num from a where num in(select num from b)
select num from a where exists(select 1 from b where num=a.num)