Note
This variable is available starting with V2.1.
Description
parallel_servers_target specifies the parallel query queuing conditions for each server.
When the total number of threads consumed by multiple parallel executions (Parallel eXecution, PX) exceeds the parallel query queuing conditions, subsequent parallel execution SQL statements must wait in a queue.
Privilege requirements
Query variables
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) and theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the values of global system variables.Modify variables
The
systenant can directly modify the values of global system variables.MySQL user tenants need to have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.Oracle user tenants need to have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0, which has no special meaning. This value is automatically set when a tenant is created. |
| Value range | [0, 9223372036854775807] |
| Scope | Global |
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
parallel_servers_target is a tenant-level variable. When a tenant is created:
If the
parallel_servers_targetvalue is specified in the CREATE TENANT statement, the tenant uses the specified value to setparallel_servers_target.The statement for specifying the
parallel_servers_targetvalue when creating a tenant is as follows:obclient> CREATE TENANT IF NOT EXISTS <tenant_name> CHARSET='utf8mb4', ZONE_LIST=('zone1'), PRIMARY_ZONE='zone1', RESOURCE_POOL_LIST=('<pool_name>') set parallel_servers_target = 624;If the
parallel_servers_targetvalue is not specified when creating a tenant, the value is automatically calculated based on themin_cpuparameter during the tenant creation process on the OBServer node.You can log in to the tenant and use the following statement to view the value:
obclient> show variables like 'parallel_servers_target';The automatically calculated
parallel_servers_targetvalue is usually small and can only meet the needs of simple parallel queries. If you want to use parallel operations in this tenant, we recommend that you manually set the value to a larger value. The recommended algorithm isparallel_servers_target = max_cpu * 10.
Examples
Set the parallel query queuing condition to 624 for each server.
obclient> SET GLOBAL parallel_servers_target = 624;