One option for improving query performance is to rewrite the query in order to obtain a completely different execution plan. In this episode we look at how it's possible to rewrite queries with Window Functions into more traditional GROUP BY syntax and what causes the difference in performance.
Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/DataWithBer...
Related blog post with example code:
https://bertwagner.com/2019/04/16/win...
More examples with Window Functions: • GAPS and ISLANDS in SQL Server
Download the StackOverflow database for yourself: https://www.brentozar.com/archive/201...
Follow me on Twitter:
/ bertwagner