Rechercher dans le manuel MySQL
8.3 Optimization and Indexes
[+/-]
- 8.3.1 How MySQL Uses Indexes
- 8.3.2 Primary Key Optimization
- 8.3.3 SPATIAL Index Optimization
- 8.3.4 Foreign Key Optimization
- 8.3.5 Column Indexes
- 8.3.6 Multiple-Column Indexes
- 8.3.7 Verifying Index Usage
- 8.3.8 InnoDB and MyISAM Index Statistics Collection
- 8.3.9 Comparison of B-Tree and Hash Indexes
- 8.3.10 Use of Index Extensions
- 8.3.11 Optimizer Use of Generated Column Indexes
- 8.3.12 Invisible Indexes
- 8.3.13 Descending Indexes
- 8.3.14 Indexed Lookups from TIMESTAMP Columns
The best way to improve the performance of
SELECT
operations is to create
indexes on one or more of the columns that are tested in the
query. The index entries act like pointers to the table rows,
allowing the query to quickly determine which rows match a
condition in the WHERE
clause, and retrieve the
other column values for those rows. All MySQL data types can be
indexed.
Although it can be tempting to create an indexes for every possible column used in a query, unnecessary indexes waste space and waste time for MySQL to determine which indexes to use. Indexes also add to the cost of inserts, updates, and deletes because each index must be updated. You must find the right balance to achieve fast queries using the optimal set of indexes.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-optimization-indexes.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.