Covered Queries and Index Intersection

Mentioned earlier in this chapter were different ways to access data, depending on the available indexes. Let's consider the example of Listing 6.18. If you had an index on (City, CompanyName, ContactName), this index has every field required to execute the query. In this case, it is not required to access the data pages, resulting in a more efficient access method. Figures 6.19 and 6.20 show the query plan with and without this index.

Figure 6.19. SQL Server uses the index on (City, CompanyName, ContactName) to cover the query.

Figure 6.20. SQL Server needs access to the data pages to execute the query ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.