8.2.1 Optimizing SELECT Statements优化SELECT语句

8.2.1.1 WHERE Clause Optimization子句优化
8.2.1.2 Range Optimization优化
8.2.1.3 Index Merge Optimization索引合并优化
8.2.1.4 Hash Join Optimization哈希连接优化
8.2.1.5 Engine Condition Pushdown Optimization引擎条件下推优化
8.2.1.6 Index Condition Pushdown Optimization索引条件下推优化
8.2.1.7 Nested-Loop Join Algorithms嵌套循环连接算法
8.2.1.8 Nested Join Optimization嵌套联接优化
8.2.1.9 Outer Join Optimization外部连接优化
8.2.1.10 Outer Join Simplification外连接简化
8.2.1.11 Multi-Range Read Optimization多量程读优化
8.2.1.12 Block Nested-Loop and Batched Key Access Joins块嵌套循环和批处理密钥访问联接
8.2.1.13 Condition Filtering条件过滤
8.2.1.14 Constant-Folding Optimization常量折叠优化
8.2.1.15 IS NULL Optimization优化
8.2.1.16 ORDER BY Optimization优化
8.2.1.17 GROUP BY Optimization优化
8.2.1.18 DISTINCT Optimization优化
8.2.1.19 LIMIT Query Optimization查询优化
8.2.1.20 Function Call Optimization函数调用优化
8.2.1.21 Window Function Optimization窗口函数优化
8.2.1.22 Row Constructor Expression Optimization行构造函数表达式优化
8.2.1.23 Avoiding Full Table Scans避免全表扫描

Queries, in the form of SELECT statements, perform all the lookup operations in the database. 查询以SELECT语句的形式执行数据库中的所有查找操作。Tuning these statements is a top priority, whether to achieve sub-second response times for dynamic web pages, or to chop hours off the time to generate huge overnight reports.调整这些语句是重中之重,无论是实现动态网页的次秒响应时间,还是缩短生成大量夜间报告的时间。

Besides SELECT statements, the tuning techniques for queries also apply to constructs such as CREATE TABLE...AS SELECT, INSERT INTO...SELECT, and WHERE clauses in DELETE statements. 除了SELECT语句外,查询的调优技术还适用于诸如CREATE TABLE...AS SELECTINSERT INTO...SELECTDELETE语句中的WHERE子句等构造。Those statements have additional performance considerations because they combine write operations with the read-oriented query operations.这些语句有额外的性能考虑,因为它们将写操作与面向读的查询操作结合起来。

NDB Cluster supports a join pushdown optimization whereby a qualifying join is sent in its entirety to NDB Cluster data nodes, where it can be distributed among them and executed in parallel. NDB群集支持连接下推优化,将符合条件的join整体发送到NDB群集数据节点,在这些节点之间可以分布并并行执行。For more information about this optimization, see Conditions for NDB pushdown joins.有关此优化的详细信息,请参见NDB下推联接的条件

The main considerations for optimizing queries are:优化查询的主要考虑因素有:

8.2.1.1 WHERE Clause Optimization
8.2.1.2 Range Optimization
8.2.1.3 Index Merge Optimization
8.2.1.4 Hash Join Optimization
8.2.1.5 Engine Condition Pushdown Optimization
8.2.1.6 Index Condition Pushdown Optimization
8.2.1.7 Nested-Loop Join Algorithms
8.2.1.8 Nested Join Optimization
8.2.1.9 Outer Join Optimization
8.2.1.10 Outer Join Simplification
8.2.1.11 Multi-Range Read Optimization
8.2.1.12 Block Nested-Loop and Batched Key Access Joins
8.2.1.13 Condition Filtering
8.2.1.14 Constant-Folding Optimization
8.2.1.15 IS NULL Optimization
8.2.1.16 ORDER BY Optimization
8.2.1.17 GROUP BY Optimization
8.2.1.18 DISTINCT Optimization
8.2.1.19 LIMIT Query Optimization
8.2.1.20 Function Call Optimization
8.2.1.21 Window Function Optimization
8.2.1.22 Row Constructor Expression Optimization
8.2.1.23 Avoiding Full Table Scans