Day 15. Creating Indexes on Tables to Improve Performance

Today, we talk about indexes, which provide you with a shorter route to your data. So far, you have learned how to create tables, populate tables with data, and select data from tables. Now, how can we get to data faster? Using indexes. Indexes are objects based on data in tables. Unlike views, which we discussed during the previous day, indexes do indeed require physical storage. By the end of today, you will understand the following:

  • How to create indexes

  • How to create composite indexes

  • What indexes do

  • When indexes should be used

  • When it is better not to use an index

An index is a way of presenting data differently than the way it appears on the disk. Special types of indexes reorder the ...

Get Sams Teach Yourself SQL in 21 Days, Fourth 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.