8.2.2 Optimizing Subqueries, Derived Tables, View References, and Common Table Expressions优化子查询、派生表、视图引用和公共表表达式

8.2.2.1 Optimizing IN and EXISTS Subquery Predicates with Semijoin Transformations使用半连接转换优化IN和EXISTS子查询谓词
8.2.2.2 Optimizing Subqueries with Materialization用物化方法优化子查询
8.2.2.3 Optimizing Subqueries with the EXISTS Strategy使用EXISTS策略优化子查询
8.2.2.4 Optimizing Derived Tables, View References, and Common Table Expressions with Merging or Materialization通过合并或物化优化派生表、视图引用和公共表表达式
8.2.2.5 Derived Condition Pushdown Optimization导出条件下推优化

The MySQL query optimizer has different strategies available to evaluate subqueries:MySQL查询优化器有不同的策略可用于评估子查询:

For a derived table, the optimizer has these choices (which also apply to view references and common table expressions):对于派生表,优化器有以下选择(也适用于视图引用和公共表表达式):

The following discussion provides more information about the preceding optimization strategies.下面的讨论提供了有关上述优化策略的更多信息。

Note注意

A limitation on UPDATE and DELETE statements that use a subquery to modify a single table is that the optimizer does not use semijoin or materialization subquery optimizations. 使用子查询修改单个表的UPDATEDELETE语句的一个限制是优化器不使用半联接或物化子查询优化。As a workaround, try rewriting them as multiple-table UPDATE and DELETE statements that use a join rather than a subquery.作为一种变通方法,请尝试将它们重写为使用联接而不是子查询的多表UPDATEDELETE语句。

8.2.2.1 Optimizing IN and EXISTS Subquery Predicates with Semijoin Transformations
8.2.2.2 Optimizing Subqueries with Materialization
8.2.2.3 Optimizing Subqueries with the EXISTS Strategy
8.2.2.4 Optimizing Derived Tables, View References, and Common Table Expressions with Merging or Materialization
8.2.2.5 Derived Condition Pushdown Optimization