What types of indexes in MySQL have you worked with?
Asked at
AI answer
In your answer, it’s important to name not only the types, but also the queries for which you used them. For example: I use B-tree indexes most often—regular, unique, and composite indexes; I choose composite indexes based on column order and query conditions. I’ve also used covering indexes to reduce table lookups, and FULLTEXT for full-text search. In InnoDB, the primary key is clustered, and secondary indexes store a reference to it.
I check indexes with EXPLAIN and take their maintenance cost into account: they use space and slow down inserts and updates. The specific list should reflect your actual experience; for example, mention SPATIAL or functional indexes only if you have really worked with them.
Also asked at SkyCoach
Similar questions
- What do you know about indexes? How can you determine which indexes are used in a query, and how can you tell which indexes are unnecessary or missing?
- What is a composite index, what is the main principle behind how it works, and how do you choose which fields to include?
- Can you list the main types of index structures used in MySQL?
- Which versions of PHP have you mainly worked with?
- What is a B-tree?