Defining and Managing Indexes

Now that you have seen what indexes are and what they can do for the performance of your SQL queries, you will learn how to create and maintain any indexes on your database. Before you start creating indexes, you need to consider where you need indexes and on which columns. In addition, you also must decide whether to use clustered or nonclustered indexes. When considering whether to create an index on a column, you should consider whether and how an indexed column is going to be used in a query. What follows are some suggestions in deciding if indexes are useful in a query:

  • Searches for rows that match a specific search key value (an exact match query). An exact match comparison is one in which the query uses the ...

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.