From the course: Developing Microsoft SQL Server 2016 Databases
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Improve queries with covering indexes - SQL Server Tutorial
From the course: Developing Microsoft SQL Server 2016 Databases
Improve queries with covering indexes
- [Narrator] When an index includes all of the columns required to satisfy a query request, the index is said to cover the query. This means that no additional table seeks are required by the query engine. In fact, SQL Server doesn't even have to return to the base table at all. These covering indexes can be a very efficient way to handle some of your most issued queries. Let's go ahead and see how they work, and we'll do so inside of the WideWorldImporters database. First, I'm going to take a look at this simple SELECT statement. We're going to pull out the fields PersonID, fullname, and EmailAddress out of a table called Application.People. If I select lines six through eight and execute them, you'll see the results in the table down below. If we take a look at the execution plan for this, by clicking on this button on the toolbar, we can that SQL Server only had to perform a single index scan on a non-clustered index.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.