sql语句优化(一)

1.查看执行时间和cpu占用时间

set statistics time on
select * from dbo.Product
set statistics time off

2.查看查询对I/0的操作情况

set statistics io on
select * from dbo.Product
set statistics io off


如果物理读取次数和预读次说比较多,可以使用索引进行优化。

如果你不想使用sql语句命令来查看这些内容,方法也是有的,哥教你更简单的。

查询--->>查询选项--->>高级

原文地址:https://www.cnblogs.com/xiaohuizhenyoucai/p/10510143.html