PolarDB allows you to specify the parallel_degree_policy parameter to set the degree of parallelism (DOP) policy for parallel queries. This topic describes the parameters that are related to DOP policies.
A ApsaraDB PolarDB MySQL-compatible edition cluster is used and the revision version must be 22.214.171.124.11 or later. For more information, see Query the kernel version number.
|parallel_degree_policy||Global||Specify a DOP policy for an individual query. Valid values:
Note For more information on how to use parallel queries, see Parallel query.
If the parameter is set to TYPICAL, PolarDB sets the DOP to the same value as
max_parallel_degree, regardless of database loads, such as the CPU usage.
If the parameter is set to AUTO, PolarDB enables or disables parallel queries based on the CPU usage, memory usage, or input/output operations per second (IOPS) usage of the database. PolarDB also sets DOP based on the costs of parallel queries.
||The threshold of the CPU usage. If the CPU usage exceeds the threshold, PolarDB disables parallel queries.|
||The threshold of the memory usage. If the memory usage exceeds the threshold, PolarDB disables parallel queries.|
||The threshold of the IOPS usage. If the IOPS usage exceeds the threshold, PolarDB disables parallel queries.|
||The policy that is used to automatically set DOP. After you enable parallel queries,
PolarDB sets the DOP based on the following rules:
Note This parameter is used to set the DOP only after PolarDB enables parallel queries. It is not used to enable or disable parallel queries.
If the parameter is set to REPLICA_AUTO, only read-only nodes enable or disable parallel queries based on the CPU usage, memory usage, or IOPS usage of the database. The primary node does not perform parallel queries. The supported parameters are the same as those of AUTO.