Erik Darling has a couple blog posts getting deeper into Adaptive Join Optimizations in SQL Server 2017. First, Erik discusses the basics:
You see, in every plan, you see both possible paths the optimizer could have chosen. Right now it’s only limited to two choices, Nested Loops and Hash Joins.
Just guessing that Merge Joins weren’t added because there would have been additional considerations around the potential cost of a Sort operation to get the data in order.
Be sure to read Brent’s comment that in the initial release, it will just support columnstore indexes. Then, Erik talks about execution plan details:
Some points of interest:
- Actual Join Type: doesn’t tell you whether it chose Hash or Nested Loops
- Estimated Join Type: Probably does
- Adaptive Threshold Rows: If the number of rows crosses this boundary, Join choice will change. Over will be Hash, under will be Nested Loops.
The rest is fairly self-explanatory and is the usual stuff in query plans.
Good stuff here.