How SQL Server Uses Indexes

Indexes are used to provide fast access to data. An index in a database is much like an index in a book. When you are looking for a specific topic in a book, you would use the index to find the page or pages where the topic is located. In a database, when you are looking for a specific row of data in a table, SQL Server uses an index to find where that row is physically located. There are two main differences between a book index and one that exists in SQL Server. First, with a book, you decide whether or not to use the book index. This option does not exist in SQL Server. The database system itself decides whether to use an existing index or not. Second, a book index is edited together with the book and does not change ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.