SQL Server execution plan cost (Continued 2)

Source: Internet
Author: User
Hash connections hash and merge connections are used to separate internal and external sources. The connection condition cannot be used as a search parameter. If you do not specify search parameters for a table or an inappropriate index, scan the table. It is possible to hash and merge connections with bookmarked search operations, but not necessarily, unless the connection type is specified forcibly. The following query explicitly declares a hash connection. Each table in the Join Operation specifies a search condition, and both tables have clustered indexes or overwrite indexes. SELECTm. ID, n. ValueFROMM2C Hash connection

Hash and merge connections are used to separate internal and external sources. The connection condition cannot be used as a search parameter. If you do not specify search parameters for a table or an inappropriate index, scan the table. It is possible to hash and merge connections with bookmarked search operations, but not necessarily, unless the connection type is specified forcibly.

The following query explicitly declares a hash connection. Each table in the Join Operation specifies a search condition, and both tables have clustered indexes or overwrite indexes.

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

-The execution plan in "19" consists of three parts: index search operations on each source plus hash connections. The cost details of hash connections are shown in-20.

-19. Hash connection execution plan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.