zoukankan      html  css  js  c++  java
  • SQL SERVER中非聚集索引的覆盖,连接,交叉,过滤

    1.覆盖索引:select和where中包含的结果集中应存在“非聚集索引列”,这样就不用查找基表了,索引表即可搞定;
     
    2.索引交叉:索引的交叉可以理解成建立多个非聚集索引之间的join,如表实体一样,因为每个非聚集索引都会保存两件东西  1是聚集索引键(存在的话,如果不存在就会存储实际表的行),2则是非聚集索引的键值。
     
    3.索引连接:是索引交叉的特例(select l1,l2 from t_ where  l1='asd'  and  l2='qwe');
     
    4.索引过滤:在创建索引的时候加上特定的过滤条件;
     
     
     
    备注:
        
        create nonclustered index aaa on  [111].[dbo].[SYS_Message]([Type],[Subject]) include ([status])  include包含进来的不会作为增加“键”的宽度
            create nonclustered index ccc on  [111].[dbo].[SYS_Message]([Subject])
    

      

           索引过滤
           例子如下  :  
     create nonclustered index aaa on  [111].[dbo].[SYS_Message]([Type],[Subject])  where [Subject]=0
    

      

  • 相关阅读:
    允许debian wheezy支持IOS7+的iphone.
    openSUSE 国内镜像摘要
    策略模式总结
    顺序串
    WindowState注意事项
    NLP | 自然语言处理
    Using Autorelease Pool Blocks
    NSAutoreleasePool & thread
    oc语言特性
    oc语言基础整理
  • 原文地址:https://www.cnblogs.com/zzq-include/p/4308754.html
Copyright © 2011-2022 走看看