What makes the optimizer insert a sort operator in the plan
0
votes
1
answer
81
views
What are the reasons that the optimizer chooses to insert a sort operator in the plan (to satisfy a stream aggregate or a merge join, etc.) instead of going for hash match or hash join?
I have now see a couple of examples where it obviously makes a mistake and hinting the query will make it a lot faster.
The examples I have seen are from SQL Server 2016.
Asked by xhr489
(827 rep)
Feb 2, 2023, 02:32 PM
Last activity: Feb 3, 2023, 05:15 PM
Last activity: Feb 3, 2023, 05:15 PM