CREATE RESOURCE POOL creates a resource pool and specifies the Cgroup for the resource pool.
As long as the current user has CREATE permission, it can create a resource pool.
1 2 | CREATE RESOURCE POOL pool_name [WITH ({MEM_PERCENT=pct | CONTROL_GROUP="group_name" | ACTIVE_STATEMENTS=stmt | MAX_DOP = dop | MEMORY_LIMIT='memory_size' | io_limits=io_limits | io_priority='io_priority' | nodegroup="nodegroupname" | is_foreign=boolean }[, ... ])]; |
Specifies the name of a resource pool.
The name of a resource pool cannot be same as that of an existing resource pool.
Value range: a string. It must comply with the naming convention.
Specifies the name of a Cgroup.
Value range: a string. It must comply with the rule in the description, specifying an existing Cgroup.
Specifies the maximum number of statements that can be concurrently executed in a resource pool.
Value range: Numeric data ranging from -1 to INT_MAX.
Specifies the maximum number of simple SQL statements that can be concurrently executed in a resource pool.
Value range: Numeric data ranging from 1 to INT_MAX.
Specifies the maximum storage for a resource pool.
Value range: a string, from 1KB to 2047GB.
Specifies the proportion of available resource pool memory to the total memory or group user memory.
In multi-tenant scenarios, mem_percent of group users or service users ranges from 1 to 100. The default value is 20.
In common scenarios, mem_percent of common users ranges from 0 to 100. The default value is 0.
When both of mem_percent and memory_limit are specified, only mem_percent takes effect.
This parameter has been discarded in 8.1.2 and is reserved for compatibility with earlier versions.
This parameter has been discarded in 8.1.2 and is reserved for compatibility with earlier versions.
Specifies the name of a logical cluster where the resource pool is. The logical cluster must already exist.
If the logical cluster name contains uppercase letters or special characters or begins with a digit, enclose the name with double quotation marks in SQL statements.
In logical cluster mode, the current resource pool is used to control the resources of common users who are not associated with the logical cluster specified by nodegroup.
This example assumes that Cgroups have been created by users in advance.
Create a default resource pool, and associate it with the Medium Timeshare Cgroup under Workload under DefaultClass.
1 | CREATE RESOURCE POOL pool1; |
Create a resource pool, and associate it with the High Timeshare Cgroup under Workload under DefaultClass.
1 | CREATE RESOURCE POOL pool2 WITH (CONTROL_GROUP="High"); |
Create a resource pool, and associate it with the Low Timeshare Cgroup under Workload under class1.
1 | CREATE RESOURCE POOL pool3 WITH (CONTROL_GROUP="class1:Low"); |
Create a resource pool, and associate it with the wg1 Workload Cgroup under class1.
1 | CREATE RESOURCE POOL pool4 WITH (CONTROL_GROUP="class1:wg1"); |
Create a resource pool, and associate it with the wg2 Workload Cgroup under class1.
1 | CREATE RESOURCE POOL pool5 WITH (CONTROL_GROUP="class1:wg2:3"); |