AnalyticDB for MySQL elastic cluster allows you to execute the CREATE RESOURCE GROUP
statement to create a resource pool. The resource granularity of a resource pool
is the number of compute nodes.
Syntax
CREATE RESOURCE GROUP resource_group_name
[QUERY_TYPE = {interactive, batch, default_type}]
[NODE_NUM = N]
- The name of a custom resource pool is specified by the
resource_group_name
parameter, and the name of the default resource pool is specified by theuser_default
parameter. You cannot set the two parameters to the same value. - Resource pool names are not case-sensitive. For example, test_group and Test_Group indicate the same resource pool. The display name of the resource pool is TEST_GROUP.
Parameters
Parameter | Description |
---|---|
QUERY_TYPE | The query execution mode. Valid values:
|
NODE_NUM | The number of nodes in a resource pool. Default value: 0. |
Examples
- Create a resource pool.
- Execute the following statement to create a resource pool that contains a single compute
node:
CREATE RESOURCE GROUP 'BATCH_RG' NODE_NUM=1;
- Execute the following statement to create a resource pool whose query execution mode
is set to batch:
CREATE RESOURCE GROUP 'BATCH_RG' QUERY_TYPE=batch NODE_NUM=1;
- Execute the following statement to create a resource pool that contains a single compute
node:
- View current resource pools.
SELECT * FROM INFORMATION_SCHEMA.RESOURCE_GROUPS;