8.8 Understanding the Query Execution Plan理解查询执行计划

8.8.1 Optimizing Queries with EXPLAIN使用EXPLAIN优化查询
8.8.2 EXPLAIN Output Format解释输出格式
8.8.3 Extended EXPLAIN Output Format扩展解释输出格式
8.8.4 Obtaining Execution Plan Information for a Named Connection获取命名连接的执行计划信息
8.8.5 Estimating Query Performance估计查询性能

Depending on the details of your tables, columns, indexes, and the conditions in your WHERE clause, the MySQL optimizer considers many techniques to efficiently perform the lookups involved in an SQL query. 根据表、列、索引的详细信息以及WHERE子句中的条件,MySQL优化器会考虑许多技术来高效地执行SQL查询中涉及的查找。A query on a huge table can be performed without reading all the rows; a join involving several tables can be performed without comparing every combination of rows. 可以在不读取所有行的情况下执行对大型表的查询;可以执行涉及多个表的联接,而无需比较每一行的组合。The set of operations that the optimizer chooses to perform the most efficient query is called the query execution plan, also known as the EXPLAIN plan. 优化器选择执行最有效查询的操作集称为“查询执行计划”,也称为解释计划。Your goals are to recognize the aspects of the EXPLAIN plan that indicate a query is optimized well, and to learn the SQL syntax and indexing techniques to improve the plan if you see some inefficient operations.您的目标是识别EXPLAIN计划中表明查询优化良好的方面,并学习SQL语法和索引技术,以便在看到一些低效操作时改进计划。

8.8.1 Optimizing Queries with EXPLAIN
8.8.2 EXPLAIN Output Format
8.8.3 Extended EXPLAIN Output Format
8.8.4 Obtaining Execution Plan Information for a Named Connection
8.8.5 Estimating Query Performance