Skip to main content
CREATE RESOURCE GROUP creates a resource group. For more information, see Resource group. Tip This operation requires the SYSTEM-level CREATE RESOURCE GROUP privilege. You can follow the instructions in GRANT to grant this privilege.

Syntax

Parameters

  • resource_group_name: The name of the resource group to be created.
  • IF NOT EXISTS: If a resource group with the same name already exists, the statement does nothing and does not return an error.
  • OR REPLACE: If a resource group with the same name already exists, it is replaced by the new resource group.
  • CLASSIFIER: Classifiers used to filter the queries on which resource limits are imposed. You must specify a classifier using "key"="value" pairs. You can set multiple classifiers for a resource group. TO and the classifiers are required, except for a resource group whose type is mv (supported from v3.1.0 onwards), which does not support classifiers. Parameters for classifiers are listed below:
  • resource_limit: Resource limits to be imposed on the resource group. You must specify resource limits using "key"="value" pairs. You can set multiple resource limits for a resource group. Parameters for resource limits are listed below:
    NOTE Before v3.3.5, StarRocks allowed setting the type of a resource group to short_query. However, the parameter type has been deprecated and replaced by exclusive_cpu_cores. For any existing resource groups of this type, the system will automatically convert them to an Exclusive resource group where the exclusive_cpu_cores value equals the cpu_weight after upgrading to v3.3.5.

Example

Example 1: Creates a Shared resource group rg1 based on multiple classifiers.
Example 2: Creates an Exclusive resource group rg2 based on multiple classifiers.