zoukankan      html  css  js  c++  java
  • SQL Server 的 TSQL 语句的性能评估方法

    在查询窗口中输入以下命令     

    dbcc dropcleanbuffers      --注释清除数据     
    dbcc  freeproccache            --注释清除缓存     
    --这是为了每次查询时,不会因为重复查询对结果有干扰,接着在窗口中输入以下命令。            
    
    Set statistics io on           --注释开启系统资源使用统计            
    Set statistics time on         --注释开启执行时间统计   

    然后在窗口中输入查询命令,如

    SELECT TOP 1000000 * FROM [SearchInfo]

    在消息框中就会出现如下结果     

    SQL Server parse and compile time:      
    CPU time = 0 ms, elapsed time = 0 ms.    
    (999999 row(s) affected)    
     Table 'SearchInfo'. Scan count 1, logical reads 17890, physical reads 29, read-ahead reads 17309, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.     
    SQL Server Execution Times:    
     CPU time = 2153 ms,  elapsed time = 22354 ms.

    总结下来就是说,在你的T-SQL语句前加上这四句T-SQL语句就可以了

    dbcc dropcleanbuffers      --注释清除数据     
    dbcc  freeproccache            --注释清除缓存     
    Set statistics io on           --注释开启系统资源使用统计            
    Set statistics time on         --注释开启执行时间统计 

    转自百度文库 —— http://wenku.baidu.com/view/5b8126d3b14e852458fb575f.html

  • 相关阅读:
    JDE函数--获取当前登录人的描述
    JDE报表开发笔记(R5537011 收货校验统计表)
    JDE函数--GetUDC(B函数)
    JDE隐藏Constant等(Hide Object)
    Oracle “dba_tables”介绍
    word2013设置页面边框
    makefile--#的不正确使用
    CICS定时
    程序的命名
    UE上传到FTP,会多出些字符
  • 原文地址:https://www.cnblogs.com/java20130722/p/3207108.html
Copyright © 2011-2022 走看看