SQL Server中,分析SQL语句执行效率

                         【摘要】
对SQL语句进行执行效率分析,特别针对有几种不同方案,但是在查询分析器中执行时间接近的情况。
【内容】
 

set statistics io on --打开IO
set statistics time on -- 打开时间统计
set statistics profile on

select .... -- 需要分析的SQL语句

set statistics io off
set statistics time off
set statistics profile off

这样一来,不同sql语句的执行时间,命令中的影响行数就会一目了然,方便我们深入的分析。

posted @ 2012-07-13 22:08  超级塞亚人  阅读(236)  评论(0)    收藏  举报