Rate This Document
Findability
Accuracy
Completeness
Readability

Parallel Query Parameters

Table 1 describes the six new parallel query parameters.

Table 1 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.

  • Value range: 0 to ULONG_MAX
  • Default value: 1000

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.

  • Value range: 0 to 1024
  • Default: 4

parallel_max_threads

Global-level parameter, which is used to set the total number of concurrent query threads.

  • Value range: 0 to ULONG_MAX
  • Default value: 64

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.

  • Value range: 0 to ULONG_MAX
  • Default value: 100 x 1024 x 1024

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.

  • Value range: 0 to ULONG_MAX, in milliseconds
  • Default value: 0

force_parallel_execute

Global- and session-level parameter, which is used to set the switch for parallel queries.

  • The bool value is on or off.

    The value on enables parallel query while off disables parallel query.

  • Default value: off

Table 2 describes the four new status variables.

Table 2 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.