Last time on T-SQL Tip 9, we covered what execution plan scans are and why to avoid them. Well, this week we are going to avoid them by using non-clustered indexes, see T-SQL Tip 5. To build a useful non-clustered index, we are going to look at our queries and identify three parts: Filters, Sorts, and Outputs. Once identified, take every column in the WHERE clause and put them first. Next, take every column in an ORDER BY or JOIN and put them second. Throw an INCLUDE at the end and put in a reasonable amount of columns from the SELECT.