multiple-column In the previous post for this ongoing “ EXPLAIN FORMAT=JSON is Cool! ” series, we discussed covered indexes and how the used_columns array can help to choose them wisely. There is one more type of multiple-column indexes: composite indexes . Composite indexes are just indexes on multiple columns. Covered indexes are a subgroup of the larger set “composite indexes.” In this post we’ll discuss how “used_key_parts” can help show which part of a multiple column key is being used.

You should prioritize using composite indexes when you have queries that search on both a set of multiple columns and a single column. For example, if you run queries like: