本文共 706 字,大约阅读时间需要 2 分钟。
SQL Server中,测试插入大量数据,执行时间。
declare @begin_date datetimedeclare @end_date datetimeselect @begin_date = getdate()declare @counter intset @counter=0while(@counter < 1000000)beginINSERT INTO testsql.dbo.Errorlog VALUES(''+@counter+'','b','c','d','e','f')set @counter=@counter + 1endselect @end_date = getdate()select datediff(ms,@begin_date,@end_date) as '用时/毫秒'--1====3--10====3--100===20--1000===300--10000===2490--100000===30000--1000000===328936--10000000===--29513--31416--30066--30066--31326declare @begin_date datetimedeclare @end_date datetimeselect @begin_date = getdate()select COUNT(tid) from errorlogselect @end_date = getdate()select datediff(ms,@begin_date,@end_date) as '用时/毫秒'
最新内容请见作者的GitHub页:
转载地址:http://wjpfx.baihongyu.com/