Effective indexes are one of the best ways to improve performance in a database application. Without an index, the SQL Server engine is like a reader trying to find a word in a book by examining each page. By using the index in the back of a book, a reader can complete the task in a much shorter time, same way SQL Server uses the index to find data in a table. There is no. of aspects we need to look at before creating an index. Too many index or index in the wrong column also degrade the performance, thus we need to build the proper index to get the maximum performance with minimum resources and time. In this lab, we will look at different aspects that we need to look, before building an index. In the first exercise of this lab, we will look at how index are used in case of joins. In the second exercise, we will look at how index are used in case of aggregates. In the third exercise, we will look at SARGable and index.
Exercise 1: Indexing for Joins
Exercise 2: Indexing for Aggregates
Exercise 3: Index and SARGable