FAQs
Table 1 lists the frequently asked questions in the application scenarios of MySQL parallel query optimization application.
No. |
Question |
Answer |
|---|---|---|
1 |
Are where and limit mandatory for the trustlist format in the application scenarios of MySQL parallel query optimization? |
No. In the trustlist format of the MySQL parallel query optimization application scenarios, select and from are mandatory, and where, group by, having, order by, and limit are optional. |
2 |
Must the trigger conditions of MySQL parallel query optimization meet the trustlist format? |
Yes. |
3 |
Some semi-join queries do not support parallel queries. Can I get an example? |
Parallel queries may not be supported in scenarios where semi-join queries involve complex subqueries or special join operations. For example, multi-level nested subqueries and uncommon join operations, such as anti-join (a variant of NOT EXISTS). |
4 |
Does the trustlist format need to be met when the hint syntax is used for parallel query? |
Yes. The trigger conditions of MySQL parallel query optimization must meet the trustlist format. |
5 |
Will parallel query be triggered when system parameters meet requirements and the trust format is met? |
Yes. |
6 |
How do I determine whether a parallel query is triggered? |
Check whether the keyword parallel is displayed in the execution plan. |
7 |
Can the four status variables PQ_threads_running, PQ_memory_used, PQ_threads_refused, and PQ_memory_refused of the parallel query be used as the observation points for the triggered parallel query? |
The PQ_threads_running status variable can be used as the observation point for the triggered parallel query. If a parallel query is performed, the value of PQ_threads_running increases. After the query is complete, the value of PQ_threads_running is restored. |
8 |
When the trustlist format is met, the parallel query function is enabled, and the threshold is 0, will parallel query be triggered if there is only one data record (for example, select * from t1;) in t1? |
Only one data record is considered as a const table and parallel query will not be triggered. If there is more than one data record, parallel query will be triggered. However, if the data volume is too small, the parallel query performance may be undermined. |
9 |
In the application scenarios of parallel query, can only t1,t2; be used to combine multiple tables in the multi-table trust list? Is there any other format? |
The format is not limited to t1,t2;. The supported formats depend on the query optimizer and execution plan generation policy of the database. Take SELECT t1.a, t2.b FROM t1 INNER JOIN t2 ON t1.id = t2.id; as an example. If t1 and t2 meet the single-table conditions for parallel query, the query may trigger parallel query. |
10 |
If the associated field has indexes on two tables, or the indexes on two tables are used in the condition, will index merging occur and parallel query cannot be triggered? |
In this case, if the index merging conditions are met, index merging is triggered. Index merging optimization is performed for a single table. When a table uses multiple indexes for condition scanning at the same time, index merging optimization may be triggered. You can query the execution plan to check whether index merging is triggered. When index merging is triggered, parallel query is not triggered. |