The beauty of indexes is that they can be used with multiple keys. A single key index can be thought of as a table with one column. A multi-key index or compound index can be visualized as a multi column table where the first column is sorted first, and then the next, and so on. In this recipe, we will look at how to create a compound index and examine how it works.
How to use compound indexes
Getting ready
Load the sample dataset and create an index on the city field, as described in the previous recipe.
How to do it...
- Assuming you have already created an index on the...