Sql Server 随机查询数据效率优化

 MSDN:

Sql Server 随机查询数据效率优化_第1张图片

复制代码
Declare @d Datetime Set @d=getdate() SELECT Top 1* FROM [TGBus_Card].[dbo].[Ka_Card] WHERE 0.01 >= CAST(CHECKSUM(NEWID(), CardNo) & 0x7fffffff AS float) / CAST (0x7fffffff AS int) And ActivityID = 501 And State = 0 Select [语句执行花费时间(毫秒)] = Datediff(ms,@d,Getdate())
复制代码


你可能感兴趣的:(Sql Server 随机查询数据效率优化)