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.
Prerequisites
A PolarDB for MySQL cluster is used and the revision version is 8.0.1.1.11 or later. For more information, see Query the version number.
Parameter
Parameter | Level | Description |
---|---|---|
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.
|
TYPICAL
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.
AUTO
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.
Parameter | Level | Value | Description |
---|---|---|---|
loose_auto_dop_cpu_pct_hwm | Global |
|
The threshold of the CPU usage. If the CPU usage exceeds the threshold, PolarDB disables parallel queries. |
loose_auto_dop_mem_pct_hwm |
|
The threshold of the memory usage. If the memory usage exceeds the threshold, PolarDB disables parallel queries. | |
loose_auto_dop_iops_pct_hwm |
|
The threshold of the IOPS usage. If the IOPS usage exceeds the threshold, PolarDB disables parallel queries. | |
loose_auto_dop_low_degree_cost |
|
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.
|
REPLICA_AUTO
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.