Updated on 2024-10-14 GMT+08:00

CREATE APP WORKLOAD GROUP MAPPING

Function

ALTER APP WORKLOAD GROUP MAPPING creates an application mapping group and associates it with an existing workload group.

Precautions

Only a user with the CREATE permission on the current database can perform this operation.

Syntax

1
2
CREATE APP WORKLOAD GROUP MAPPING app_name
    [ WITH ( WORKLOAD_GPNAME  = workload_gpname ) ];

Parameter Description

  • app_name

    Specifies the name of an application mapping group. The name of an application mapping group must be unique in the current database.

    Value range: a string. It must comply with the naming convention.

  • workload_gpname

    Specifies the workload group name.

    Value range: a string, which indicates the created workload group.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
-- Create a resource pool and specify the High Timeshare Workload Cgroup under the DefaultClass Cgroup.
openGauss=# CREATE RESOURCE POOL pool1 WITH (CONTROL_GROUP="High");

-- Create a workload group and associate it with the created resource pool.
openGauss=# CREATE WORKLOAD GROUP group1 USING RESOURCE POOL pool1;

-- Create an application mapping group and associate it with the created workload group.
openGauss=# CREATE APP WORKLOAD GROUP MAPPING app_wg_map1 WITH (WORKLOAD_GPNAME=group1);

-- Create a default application mapping group and associate it with the default workload group.
openGauss=# CREATE APP WORKLOAD GROUP MAPPING app_wg_map2;

-- Delete the application mapping group.
openGauss=# DROP APP WORKLOAD GROUP MAPPING app_wg_map1;
openGauss=# DROP APP WORKLOAD GROUP MAPPING app_wg_map2;

-- Delete the workload group.
openGauss=# DROP WORKLOAD GROUP group1;

-- Delete the resource pool.
openGauss=# DROP RESOURCE POOL pool1;