O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required