Note
This variable is available starting with V2.1.
Description
The parallel_servers_target variable specifies the parallel query queuing condition for each server.
When the total number of threads consumed by multiple parallel execution (PX) SQL statements exceeds the parallel query queuing condition, subsequent PX SQL statements need to 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 value of global system variables.Modify variables
The
systenant can directly modify the value of global system variables.MySQL user tenants need to have the
SUPERorALTER SYSTEMprivilege to modify the value of global system variables.Oracle user tenants need to have the
ALTER SYSTEMprivilege to modify the value 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 CREATE TENANT statement with the
parallel_servers_targetvalue specified 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 in the CREATE TENANT statement, 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 execute 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 for each server to 624.
obclient> SET GLOBAL parallel_servers_target = 624;