PolarDB allows you to set the degree of parallelism (DOP) policy for parallel queries by specifying the parallel_degree_policy parameter. This topic describes the parameters that are related to DOP policies.
A PolarDB for MySQL cluster is used and the revision version is 220.127.116.11.11 or later. For more information, see Query the version number.
|parallel_degree_policy||Global||Specifies a DOP policy for an individual query. Valid values:
Note For more information on how to use parallel queries, see Parallel query.
If the parallel_degree_policy 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 parallel_degree_policy parameter is set to AUTO, PolarDB enables or disables parallel queries based on the CPU usage, memory usage, or the input/output operations per second (IOPS) value of the database. PolarDB also sets the 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 the 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 parallel_degree_policy parameter is set to REPLICA_AUTO, only read-only nodes enable or disable parallel queries based on the CPU usage, memory usage, or the IOPS value of the database. The primary node does not perform parallel queries. The supported parameters are the same as those of AUTO.