SQL Server Index Internals Challenge

preview_player
Показать описание
The bundled content focuses on internals, troubleshooting, query tuning, performance optimization, tips, tricks, and loads of content from the real world.
Рекомендации по теме
Комментарии
Автор

In Query 1, SQL Server is removing the duplicates (those rows that satisfy both predicates) by first concatenating both result sets into an unsorted list, then sorting that list, removing the duplicates as it sorts.


In Query 2, SQL server is again removing duplicates but this time it is concatenating into an ordered set then aggregating the set to remove duplicates

So the two differing sections are both removing the duplicates, but Query 1 removes them during the process of sorting, Query 2 removes them after the list is sorted

steveearle