If not exists(Select 1 from UserProduct where UserID=@guid and ModelID=@product)
和
If not exists(Select * from UserProduct where UserID=@guid and ModelID=@product)
哪句更快些?还有比这更快的语句吗?
...全文
1326打赏收藏
请问哪个运行更快?
If not exists(Select 1 from UserProduct where UserID=@guid and ModelID=@product) 和 If not exists(Select * from UserProduct where UserID=@guid and ModelID=@product) 哪句更快些?还有比这更快的语句吗?
If not exists(Select 1 from UserProduct where UserID=@guid and ModelID=@product)
比
If not exists(Select * from UserProduct where UserID=@guid and ModelID=@product)
快一点
理论上
If not exists(Select 1 from UserProduct where UserID=@guid and ModelID=@product)
比
If not exists(Select * from UserProduct where UserID=@guid and ModelID=@product)
快一点
时间
If not exists(Select 1 from UserProduct where UserID=@guid and ModelID=@product)
<=
If not exists(Select * from UserProduct where UserID=@guid and ModelID=@product)