zoukankan      html  css  js  c++  java
  • 实践SQLServer Tuning

    已有的系统业务数据属性多,表之间关系紧密。单表数据量(5481 row(s) affected)级别(其中三四个主表),其他表数据量较小。

    0)使用set statistics生成辅助信息参考。

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

    1)使用Include Actual Execution plan & Include Client Statistics做参考。

    2) 短路表达式的面向业务优化:

      or表达式常用的搜索条件置前。

    @cls_date_start is null and @cls_date_end is null)
                    or (@cls_date_start is not null and @cls_date_end is null and expct_cls_dt >= @cls_date_start)
                    or (@cls_date_start is null and @cls_date_end is not null and expct_cls_dt <= @cls_date_end)
                    or (@cls_date_start is not null and @cls_date_end is not null and expct_cls_dt between @cls_date_start and @cls_date_end)

    3) 针对执行计划的分析。

    http://www.blogjava.net/jiabao/archive/2008/04/08/191595.html 这篇文章Mark一下,浅显又深入。

    4) 对临时表添加cluster index与unique index。以让其为连接所用并避免较大表的table scan。貌似效果不错。

  • 相关阅读:
    opengl编程指南
    Binder机制1---Binder原理介绍
    [Android]使用platform密钥来给apk文件签名的命令
    IntentFilter
    最高分是多少
    Spring注入
    Bean容器的初始化
    Spring中的Junit
    IOC
    接口及面向接口编程
  • 原文地址:https://www.cnblogs.com/jiejue/p/2772869.html
Copyright © 2011-2022 走看看