CHAPTER 14

image

Indexes

We’ve already met indexes during our database travels to date. We were creating clustered indexes when we created primary keys, and we also created unique indexes when we created unique constraints.

Indexes are important because they can greatly affect how well your database performs. The benefits of an index become apparent once your database contains a certain number of rows; it’s possible to reduce queries that can take 20 minutes (in some cases) to just two seconds. That’s how important they are.

We’ll take a tour of the various types of index you can create, look at some examples, and see how to create an indexed view. ...

Get Introducing SQL Server now with O’Reilly online learning.

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