Home > Database > Mysql Tutorial > body text

SQLServer执行计划成本(续2)

WBOY
Release: 2016-06-07 17:46:56
Original
1247 people have browsed it
哈希连接

哈希和合并连接都是分开处理内部源和外部源的。连接条件不能用作搜索参数。当没有为表或存在的不合适的索引明确指定搜索参数时,就要对那个表进行扫描。有可能哈希和合并连接有书签查找操作,但也未必,除非强制指定连接类型。

下面的查询明确声明一个哈希连接。连接操作里的每一个表指定了搜索条件,并且两个表都有聚集索引或覆盖索引。


SELECT m.ID, n.Value
FROM M2C m INNER HASH JOIN M2D n ON n.ID = m.ID
WHERE m.GroupID = @Group1 AND n.GroupID = @Group2

2-19里的执行计划由每个源上的索引搜索操作加上哈希连接共计3部分组成。哈希连接的成本细节在图2-20里显示。

2-19.哈希连接执行计划
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template