Parallel Query Parameters
Table 1 describes the six new parallel query parameters.
Parameter |
Description |
Value |
|---|---|---|
parallel_cost_threshold |
Global- and session-level parameter, which is used to set the threshold for parallel query of SQL statements. Parallel queries are executed only when the estimated cost of a query is higher than this threshold. When the estimated cost is lower than this threshold, a query process of open source MySQL is executed. |
|
parallel_default_dop |
Global- and session-level parameter, which is used to set the maximum number of parallel queries for each SQL statement. The query parallelism of a SQL statement is dynamically adjusted based on the table size. If the binary tree of the table is too small (the number of table slices is less than the concurrency), set the query concurrency based on the number of table slices. The maximum degree of parallelism for each query does not exceed the value of parallel_default_dop. The value of this parameter cannot be greater than that of parallel_max_threads. Otherwise, parallel query of SQL statements cannot be enabled. |
|
parallel_max_threads |
Global-level parameter, which is used to set the total number of concurrent query threads. |
|
parallel_memory_limit |
Global-level parameter, which is used to set the upper limit of the total memory used by the leader thread and worker threads in parallel execution. |
|
parallel_queue_timeout |
Global- and session-level parameter, which is used to set the timeout interval for parallel queries. If system resources are insufficient, for example, the number of running parallel query threads reaches the value of parallel_max_threads, the parallel query statements will wait for available resources. If no resource is available after timeout, a query process of open source MySQL is executed. |
|
force_parallel_execute |
Global- and session-level parameter, which is used to set the switch for parallel queries. |
|
Table 2 describes the four new status variables.
Status Variable |
Description |
|---|---|
PQ_threads_running |
Global-level variable, which indicates the total number of running parallel threads. |
PQ_memory_used |
Global-level variable, which indicates the total memory used for parallel execution. |
PQ_threads_refused |
Global-level variable, which indicates the total number of parallel queries that cannot be executed due to the limit on the total number of threads. |
PQ_memory_refused |
Global-level variable, which indicates the total number of parallel queries that fail to be executed due to the total memory limit. |