表扫描
当没有合适的索引时就发生表扫描操作。这可能意味着没有索引存在或者预期有很多行且比扫描整个表开销更少。如果表是一个堆表,执行计划显示表扫描操作;如果表有聚集索引或者所有需要的值都在一个非聚集索引里如图2-6显示,那么执行计划显示一个索引扫描操作。
图2-6.表扫描的执行计划和聚集索引扫描操作
图2-7和2-8显示表扫描和索引扫描操作的成本细节。索引扫描和表扫描有相同的成本结构。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn