MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0

13.7.2.2 CREATE RESOURCE GROUP Syntax

CREATE RESOURCE GROUP group_name
    TYPE = {SYSTEM|USER}
    [VCPU [=] vcpu_spec [, vcpu_spec] ...]
    [THREAD_PRIORITY [=] N]
    [ENABLE|DISABLE]

vcpu_spec: {N | M - N}

CREATE RESOURCE GROUP is used for resource group management (see Section 8.12.5, “Resource Groups”). This statement creates a new resource group and assigns its initial attribute values. It requires the RESOURCE_GROUP_ADMIN privilege.

group_name identifies which resource group to create. If the group already exists, an error occurs.

The TYPE attribute is required. It should be SYSTEM for a system resource group, USER for a user resource group. The group type affects permitted THREAD_PRIORITY values, as described later.

The VCPU attribute indicates the CPU affinity; that is, the set of virtual CPUs the group can use:

Example VCPU specifiers (these are all equivalent):

VCPU = 0,1,2,3,9,10
VCPU = 0-3,9-10
VCPU = 9,10,0-3
VCPU = 0,10,1,9,3,2

The THREAD_PRIORITY attribute indicates the priority for threads assigned to the group:

ENABLE and DISABLE specify that the resource group is initially enabled or disabled. If neither is specified, the group is enabled by default. A disabled group cannot have threads assigned to it.

Examples:

Resource group management is local to the server on which it occurs. CREATE RESOURCE GROUP statements are not written to the binary log and are not replicated.