Modifies a resource group's compute capacity, query execution mode, or database account associations in AnalyticDB for MySQL Data Warehouse Edition (V3.0).
Prerequisites
Before you begin, ensure that your cluster meets all of the following requirements:
Data Warehouse Edition (V3.0)
Elastic mode for Cluster Edition
32 cores or more
Minor version 3.1.3.2 or later
Syntax
ALTER RESOURCE GROUP resource_group_name
[QUERY_TYPE = {interactive | batch | default_type}]
[NODE_NUM = N]
[ADD_USER = user_name]
[DROP_USER = user_name]Resource group names are case-insensitive. For example, test_group and Test_Group refer to the same resource group. The name is stored and displayed in uppercase as TEST_GROUP.
Parameters
| Parameter | Description |
|---|---|
QUERY_TYPE | The query execution mode for the resource group. Valid values: interactive, batch, default_type. Default value: default_type. For details, see Query execution modes. |
NODE_NUM | The number of compute nodes to allocate to the resource group. Set to 0 to allocate no dedicated compute nodes. Default value: 0. |
ADD_USER | The database account to associate with the resource group. |
DROP_USER | The database account to disassociate from the resource group. |
Usage notes
ADD_USER and DROP_USER are mutually exclusive with all other parameters. When you specify ADD_USER or DROP_USER, you cannot modify any other attribute of the resource group in the same statement. The following statement fails because it combines ADD_USER with QUERY_TYPE:
-- This statement fails.
ALTER RESOURCE GROUP 'BATCH_RG' ADD_USER=batch_user QUERY_TYPE=default_type;To modify both account associations and other attributes, run separate ALTER RESOURCE GROUP statements.
Examples
Set the number of compute nodes
Allocate 3 compute nodes to the resource group:
ALTER RESOURCE GROUP 'BATCH_RG' NODE_NUM=3;Set the query execution mode
Reset the query execution mode to the default:
ALTER RESOURCE GROUP 'BATCH_RG' QUERY_TYPE=default_type;Modify compute nodes and query execution mode together
ALTER RESOURCE GROUP 'BATCH_RG' QUERY_TYPE=default_type NODE_NUM=3;Associate a database account with a resource group
ALTER RESOURCE GROUP 'BATCH_RG' ADD_USER=batch_user;Disassociate a database account from a resource group
ALTER RESOURCE GROUP 'BATCH_RG' DROP_USER=batch_user;Modify the default resource group
-- Set the query execution mode to batch.
ALTER RESOURCE GROUP user_default QUERY_TYPE=batch;
-- Reset the query execution mode to the default value.
ALTER RESOURCE GROUP user_default QUERY_TYPE=default_type;View all resource groups
SELECT * FROM INFORMATION_SCHEMA.RESOURCE_GROUPS;