日期:2012-06-27 05:01:00 来源:本站整理
解析SQL语句性能3种办法分享[MSSQL防范]
本文“解析SQL语句性能3种办法分享[MSSQL防范]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
第一种办法:
复制代码 代码以下:
Minimsdn.com为您供应的代码:
-- Turn ON [Display IO Info when execute SQL]
SET STATISTICS IO ON
-- Turn OFF [Display IO Info when execute SQL]
SET STATISTICS IO OFF
Link: http://msdn.microsoft.com/zh-cn/library/ms184361.aspx
第二种办法:
复制代码 代码以下:
MINIMSDN.com为您供应的代码:
--Turn ON [Display detail info and the request for resources]
SET SHOWPLAN_ALL ON
-- Turn OFF [Display detail info and the request for resources]
SET SHOWPLAN_ALL OFF
Link: http://msdn.microsoft.com/zh-cn/library/ms187735
第三种办法:
Links: http://msdn.microsoft.com/zh-cn/library/ff650689.aspx ; http://msdn.microsoft.com/zh-cn/library/aa175244(v=SQL.80).aspx
Demo For three kinds of Method:
For SQL Script:
复制代码 代码以下:
select * from dbEBMSStaging.dbo.MSSalesTxlatOrganizationMaster_Corg StagingOMC
v Its Execution plan: ()
v Its IO info: ()
- - You can try one table with 100/10000/1000000 rows but create/don't create Clustered/NONCLUSTERED Index.
v Its Detail info Etc.: ()
For SQL Script:
select top 100 * from dbEBMSStaging.dbo.MSSalesTxlatOrganizationMaster_Corg StagingOMC
v Its Execution plan: ()
v Its IO info: ()
v Its Detail info Etc.: ()
For SQL Script:
复制代码 代码以下:select top 100 * from dbEBMSStaging.dbo.MSSalesTxlatOrganizationMaster_Corg StagingOMC
order by StagingOMC.COrgTPName
v Its Execution plan: ( )
v Its IO info: ()
v Its Detail info Etc.: ()
For SQL Script:
复制代码 代码以下:select top 100 StagingOMC.COrgTPName,COUNT(CorgID) from dbEBMSStaging.dbo.MSSalesTxlatOrganizationMaster_Corg StagingOMC
group by StagingOMC.COrgTPName
order by StagingOMC.COrgTPName
v Its Execution plan: ()
v Its IO info: ()
v Its Detail info Etc.: ()
- - By these three kinds of methods, you can try to check those words in the internet web are right or wrong about how to improve SQL Script performance.
以上是“解析SQL语句性能3种办法分享[MSSQL防范]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论