MySQL performance – INDEX
At my work I’m dealing with some performance issues, and I’m kind of needing some background regarding MySQL.
I’ll add some quick notes from my researches around INDEXES:
- Indexes are used to find rows with specific column values quickly.
- Performance increase – If a table has 1,000 rows, this is at least 100 times faster than reading sequentially.
- MySQL uses indexes for these operations:
- To find the rows matching a WHERE clause quickly.
- To eliminate rows from consideration.
- To retrieve rows from other tables when performing joins.
- MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10) and CHAR(15) are not.
- To find the MIN() or MAX() value for a specific indexed column
- To sort or group a table if the sorting or grouping is done on a leftmost prefix of a usable key
I’ll update this post with all my research on this subject or create new ones!