From the course: MySQL for Non-Programmers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Create indexes

Create indexes

- [Instructor] We have a working database and some complex queries, now we'll add some indexes, but what are they and why do we need them? Indexes are used to speed up finding specific rows among potentially millions of rows, and one of the ways to optimize your database. Three of my SQL indexes you've already encountered and have used, and they are primary key, foreign key, and unique. One of the other types of indexes is the column index. And these will be discussed in using. A column index on one column is the most commonly used index. It stores copies of the values from that column in a structure that allows for the index to quickly find a value or values specified by the WHERE clause. You can also have a composite index. For example, if we'll be searching the salesperson table a lot by last name and first name, it would be a good idea to have an index created on those two column. Bear in mind that indexes add…

Contents