All Products
Search
Document Center

AnalyticDB for MySQL:CREATE RESOURCE GROUP

Last Updated:Dec 15, 2023

AnalyticDB for MySQL Data Warehouse Edition (V3.0) allows you to execute the CREATE RESOURCE GROUP statement to create a resource group. Resource groups are organized at the level of compute nodes.

Prerequisites

Your AnalyticDB for MySQL cluster must meet the following requirements:

  • The cluster is of Data Warehouse Edition (V3.0).

  • The cluster is in elastic mode for Cluster Edition.

  • The cluster has 32 cores or more.

  • The minor version of the cluster is 3.1.3.2 or later.

    Note

    For information about how to query the minor version of a cluster, see How do I query the version of an AnalyticDB for MySQL cluster? To update the minor version of a cluster, contact technical support.

  • A privileged database account is created. 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 parameter specifies the name of the resource group that you want to create. You cannot set the name of the resource group to the same value as the default resource group user_default.

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

Parameters

Parameter

Description

QUERY_TYPE

The query execution mode of the resource group. 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 current resource groups.

    SELECT * FROM INFORMATION_SCHEMA.RESOURCE_GROUPS;