Application Scenarios
The MySQL parallel query tuning feature enables parallel data read, and allows executing an SQL statement by using multiple cores and threads, and therefore accelerates the execution of query statements. This feature is mainly used in service scenarios such as data analysis, BI report, and decision-making support. The following types of single-table scan queries can be performed in parallel:
- JT_ALL
- JT_INDEX_SCAN
- JT_REF
- JT_RANGE
In addition to single tables, simple parallel query of multiple tables is allowed. Subquery is not supported. Semi join is supported in some scenarios. The solution works in trustlist mode. The details are as follows:
- Single-table trustlist:
Select {column name| Aggregate } from table where {=|>| < |>= |<= |like |between…and| in} group by {column name} having {column name}order by {column name| Aggregate } limit xAggregate: SUM MIN MAX AVG COUNT
- Multi-table trustlist:
Select {column name| Aggregate } from table1 table2 … where {=|>| < |>= |<= |like |between…and| in} group by {column name} having {column name}order by {column name} limit xParallel query does not take effect for a system table, temporary table, non-InnoDB table, stored procedure, or serialized isolation level.
- Semi-join query:
Some semi-joins may become common simple queries after being processed by the MySQL optimizer. If the innermost table in the execution plan is a foreign table, such SQL statements also support parallel query.
- Four arithmetic operations of aggregation:
Four arithmetic operations of aggregation are supported, for example, sum()/sum() and a*sum(), where a is a constant.
Security Hardening
MySQL parallel query tuning supports MySQL 8.0.20 and MySQL 8.0.25. Promptly fix the CVE vulnerabilities of the corresponding MySQL versions released on the MySQL official website.
Release Notes
This feature is released with Kunpeng BoostKit 20.03.