zoukankan      html  css  js  c++  java
  • SQL执行计划

    Table Scan 扫描
    Index Scan 索引扫描
    Index Seek 索引查找
    Clustered Index Scan 聚集索引扫描
    Clustered Index Seek 聚集索引查找

    • MS-SQL Server什么时候使用"Table Scan"?
    • MS-SQL Server什么时候使用"Index Scan"?
    • MS-SQL Server什么时候使用"Index Seek"? 
    • MS-SQL Server什么时候使用"Clustered Index Scan"?
    • MS-SQL Server什么时候使用"Clustered Index Seek"?

    首先建立索引聚集索引

    create unique clustered index index_PRCode on 表名(字段名)

    当在WHERE后用到(字段名)字段的时候,“Clustered Index Seek”被用到用到“Index Seek”是因为WHERE后面使用带索引的“字段”来进行过滤

    Index Seek(索引查找)”在性能改善上比“Index Scan(索引扫描)”和“Table Scan(表扫描)”要好,这主要表现在下面几个方面:

    1. “Index Seek”不需要对表和索引页进行扫描;而“Table Scan”和“Index Scan”需要。
    2. “Index Seek”利用“WHERE”来过滤获取的数据,这样比用“Index Scan”和“Table Scan”快很多。

    从改善性能角度考虑,“Clustered Index Seek”比“Clustered Index Scan”和“Index Seek”要好。

    1. “Clustered Index Seek”不需要扫描整个聚集索引页。
    2. 和“Index Scan”相比,对于检索选择的字段包含那些没有索引的字段时,“Clustered Index Seek”不会有“Bookmark Lookup”方法出现。
  • 相关阅读:
    到具体某一天的倒计时
    angular2 2种方式----获取子组件的类属性和类方法
    页面刷新
    angular父子组件传值
    div垂直居中,文字垂直居中!!!
    Python 基础数据类型 II (列表)
    Python 基础数据类型 I (str等)
    学习笔记411
    20190407 Word合并单元格
    VBA正则笔记 理解肯定环视
  • 原文地址:https://www.cnblogs.com/edword/p/3142324.html
Copyright © 2011-2022 走看看