Being a developer I often find myself in situations where I need to troubleshoot SQL queries that are not performing well and generally need optimizations. I would like to share some interesting tips on how SQL Server handles queries and what execution plans might be better than others. A query execution plan is an ordered set of steps that are used to access the data in SQL server. If you are working with SQL Server Management Studio once you have started a new query window click the following button (or CTRL + M) so you can enable execution plans. In the examples below I will be using tables from AdventureWorks database which is a sample database provided by Microsoft.