简单对比几条查询语句的执行时间
2017-08-25 09:43
316 查看
平时都是用第三种查询,今天看了SQL必知必会 第4版,作了几次查询实验。原来在一般情况下,还是用嵌套查询时间快些: set statistics time on; select * from ICBOMChild where FInterID in (select FInterID from ICBOM where FItemID in (select FItemID from t_ICItem where FNumber like'9.9250.%'))SQL Server 分析和编译时间: CPU 时间 = 13 毫秒,占用时间 = 13 毫秒。
SQL Server 执行时间: CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间: CPU 时间 = 0 毫秒,占用时间 = 3 毫秒。--------------------------------------------------------------------------------------------------------------------
select * from ICBOMChild t1 join ICBOM t2 on t1.FInterID=t2.FInterID join t_ICItem t3 on t2.FItemID=t3.FItemID and t3.FNumber like '9.9250.%'
SQL Server 分析和编译时间:
CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间:
CPU 时间 = 32 毫秒,占用时间 = 395 毫秒。
----------------------------------------------------------------------------------------------------------------------
set statistics time on;
select * from ICBOMChild t1,ICBOM t2,t_ICItem t3 where t1.FInterID=t2.FInterID and t2.FItemID=t3.FItemID and t3.FNumber like '9.9250.%'
SQL Server 分析和编译时间:
CPU 时间 = 31 毫秒,占用时间 = 41 毫秒。
SQL Server 执行时间:
CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间:
CPU 时间 = 32 毫秒,占用时间 = 46 毫秒。
SQL Server 执行时间: CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间: CPU 时间 = 0 毫秒,占用时间 = 3 毫秒。--------------------------------------------------------------------------------------------------------------------
select * from ICBOMChild t1 join ICBOM t2 on t1.FInterID=t2.FInterID join t_ICItem t3 on t2.FItemID=t3.FItemID and t3.FNumber like '9.9250.%'
SQL Server 分析和编译时间:
CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间:
CPU 时间 = 32 毫秒,占用时间 = 395 毫秒。
----------------------------------------------------------------------------------------------------------------------
set statistics time on;
select * from ICBOMChild t1,ICBOM t2,t_ICItem t3 where t1.FInterID=t2.FInterID and t2.FItemID=t3.FItemID and t3.FNumber like '9.9250.%'
SQL Server 分析和编译时间:
CPU 时间 = 31 毫秒,占用时间 = 41 毫秒。
SQL Server 执行时间:
CPU 时间 = 0 毫秒,占用时间 = 0 毫秒。
(272 行受影响)
SQL Server 执行时间:
CPU 时间 = 32 毫秒,占用时间 = 46 毫秒。
相关文章推荐
- 1.利用android提高的的insert,query,update,deleteAPI与execSql,rawQuery函数执行原生的插入,查询,更新,删除语句操作花费时间的对比结果
- (转)SQLServer_T-SQL 语句执行时间的查询
- 执行sql查询,并查看语句执行花费时间
- SQL SERVER查询优化工具:统计SQL语句执行时间
- PHP获取MySQL执行sql语句的查询时间方法
- mysql sql语句执行时间查询
- PHP获取MySQL执行sql语句的查询时间
- SQL Server查询SQL语句的执行时间
- SQL查询执行某条SQL语句所花费的时间
- 查询每一个执行SQL语句的时间(创建hash分区)
- 轻松查询mysql语句执行时间
- MSSQL(T-SQL)查询语句执行时间
- 查询语句执行时间
- mysql查询语句执行时间
- (转载)PHP怎么获取MySQL执行sql语句的查询时间
- mysql简单查询语句的执行顺序
- oracle查询SQL语句执行的耗时和执行时间
- C# 简单连接数据库并执行SQL查询语句
- oracle查询用户什么时间执行了什么SQL语句
- mysql sql语句执行时间查询