A Quick Tip
Sometimes it may feel like optimizing your T-SQL queries can be a guessing game, but SQL Server provides some very simple tools you can use to analyze your queries.
Simply write your T-SQL query in SQL Server Management Studio and instead of hitting execute, hit CTRL-L.
This will open a new tab below, and show you the execution plan.
In addition, it can help you build a POC index that can significantly increase performance.
P = Partitioning
O = Ordering
C = Coverage
And if you right click and choosing Missing index details, it will even give you the SQL needed to create your index and a estimation of how the index could improve the query cost.