All Products
Search
Document Center

AnalyticDB:CREATE RESOURCE GROUP

Last Updated:Aug 12, 2025

In AnalyticDB for MySQL Data Warehouse Edition, you can use the CREATE RESOURCE GROUP statement to create a resource group, which is a collection of compute nodes.

Prerequisites

Your AnalyticDB for MySQL cluster must meet the following requirements:

  • The cluster is a Data Warehouse Edition cluster.

  • The cluster is an Elastic Mode Cluster Edition (New) cluster.

  • The cluster has 32 or more cores.

  • The cluster kernel version is 3.1.3.2 or later.

    Note

    To view and update the minor version of an AnalyticDB for MySQL cluster, log on to the AnalyticDB for MySQL console and go to the Configuration Information section of the Cluster Information page.

  • The database account must be a privileged account. For more information, see Create a database account.

Syntax

CREATE RESOURCE GROUP resource_group_name
    [QUERY_TYPE = {interactive, batch, default_type}]
    [NODE_NUM = N]
  • The resource group name that you specify for resource_group_name cannot be the same as the default resource group name, user_default.

  • Resource group names are not case-sensitive. For example, test_group and Test_Group refer to the same resource group. The resource group name is displayed in uppercase as TEST_GROUP.

Parameters

Parameter

Description

QUERY_TYPE

The query execution mode. Valid values:

  • interactive

  • batch

  • default_type

Default value: default_type. For more information, see Query execution modes.

NODE_NUM

The number of compute nodes in the resource group. Default value: 0.

Examples

  1. Create a resource group.

    • Create a resource group that contains a single compute node.

      CREATE RESOURCE GROUP 'BATCH_RG' NODE_NUM=1;
    • Create a resource group whose query execution mode is batch.

      CREATE RESOURCE GROUP 'BATCH_RG' QUERY_TYPE=batch NODE_NUM=1;
  2. View the list of existing resource groups.

    SELECT * FROM INFORMATION_SCHEMA.RESOURCE_GROUPS;