Choice of Join hash join

sakuraime 2,321 Reputation points
2020-08-19T06:46:47.407+00:00

I believe sql server optimizer will choose loop join if one of the input table will be relatively small . like few rows. but in the following example show that it use hash join and using the smaller table as to build hash column in memory . so the query optimizer make a wrong choice ?

18732-hasjoin.jpg

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,550 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cris Zhan-MSFT 6,626 Reputation points
    2020-08-21T09:07:17.647+00:00

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.