This topic describes the parameters and variables of the elastic parallel query feature.
Parallel query parameters
The MySQL configuration file compatibility prefix loose_ is added to all cluster parameters in the PolarDB console. If you want to modify the parameters in the PolarDB console, make sure to modify the ones that contain the loose_ prefix.
Parameter | Level | Description |
max_parallel_degree | Global and session | The maximum DOP for an individual query. This parameter specifies the maximum number of workers that are used to run queries in parallel.
Note
|
max_parallel_workers | Global | The maximum number of parallel workers. If the number of parallel workers exceeds the specified value, new parallel queries enters the queue and waits.
Note
|
queuing_parallel_degree_limit | Global | The maximum sum of DOP values for parallel queries that can enter the queue at a time. If the specified value is exceeded, the additional query is not granted resources for parallel queries and sequential execution is used.
|
pq_max_queuing_time | Global and session | The maximum waiting time in the queue. If the waiting time in the queue exceeds the specified value, sequential execution is used.
|
parallel_degree_policy | Global | The DOP policy for an individual query. Valid values:
Note For more information about degree of parallelism configuration policies, see DOP policies. |
records_threshold_for_parallelism | Session | If the number of scanned rows exceeds the value of records_threshold_for_parallelism, the optimizer enables the elastic parallel query feature.
Note If the majority of your queries are simple and involve only a small amount of data, we recommend that you set the threshold to at least 2000. |
cost_threshold_for_parallelism | Session | If the cost of sequential queries exceeds the value of cost_threshold_for_parallelism, the optimizer enables the elastic parallel query feature.
|
records_threshold_for_mpp | session | If the number of scanned rows of a table involved in a query statement exceeds this threshold, the optimizer considers using multi-node elastic parallel query.
|
cost_threshold_for_mpp | session | If the sequential execution cost of a query statement exceeds this threshold, the optimizer considers using multi-node elastic parallel query.
|
Parallel query variables
Variable | Level | Description |
Parallel_workers_created | Global and session | The number of parallel workers that have been created since the start of the session. |
Gather_records | Global and session | The total number of records that are gathered. |
PQ_refused_over_total_workers | Global and session | The number of queries that are not performed in parallel due to the limit on the total number of workers. |
PQ_refused_over_max_queuing_time | Global and session | The number of queries that are not performed in parallel due to the timeout of parallel query queues. |
Total_running_parallel_workers | Global | The number of parallel workers that are running. |