Hour 22

Using Indexes to Improve Performance

What You’ll Learn in This Hour:

  •    How indexes work

  •    How to create an index

  •    The different types of indexes

  •    When to use indexes

  •    When not to use indexes

In this hour, you learn how to improve SQL statement performance by creating and using indexes. You begin with the CREATE INDEX command and learn how to use indexes that have been created on tables.

Defining an Index

An index is basically a pointer to data in a table. An index in a database is similar to an index in the back of a book. If you want to reference all the pages in a book that discuss a certain topic, you first refer to the index, which lists all topics alphabetically; the index then refers you to one or more specific ...

Get SQL in 24 Hours, Sams Teach Yourself, 7th 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.