DROP RESOURCE GROUP

You can use the DROP RESOURCE GROUP statement to drop a resource group.

DROP RESOURCE GROUP - 图1

Note

This feature is not available on TiDB Serverless clusters.

Synopsis

DropResourceGroupStmt

DROP RESOURCE GROUP - 图2

IfExists

DROP RESOURCE GROUP - 图3

ResourceGroupName

DROP RESOURCE GROUP - 图4

  1. DropResourceGroupStmt ::=
  2. "DROP" "RESOURCE" "GROUP" IfExists ResourceGroupName
  3. IfExists ::=
  4. ('IF' 'EXISTS')?
  5. ResourceGroupName ::=
  6. Identifier
  7. | "DEFAULT"

DROP RESOURCE GROUP - 图5

Note

  • The DROP RESOURCE GROUP statement can only be executed when the global variable tidb_enable_resource_control is set to ON.
  • The default resource group is reserved and cannot be dropped.

Examples

Drop a resource group named rg1.

  1. DROP RESOURCE GROUP IF EXISTS rg1;
  1. Query OK, 0 rows affected (0.22 sec)
  1. CREATE RESOURCE GROUP IF NOT EXISTS rg1 RU_PER_SEC = 500 BURSTABLE;
  1. Query OK, 0 rows affected (0.08 sec)
  1. SELECT * FROM information_schema.resource_groups WHERE NAME ='rg1';
  1. +------+------------+----------+-----------+-------------+
  2. | NAME | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT |
  3. +------+------------+----------+-----------+-------------+
  4. | rg1 | 500 | MEDIUM | YES | NULL |
  5. +------+------------+----------+-----------+-------------+
  6. 1 row in set (0.01 sec)
  1. DROP RESOURCE GROUP IF EXISTS rg1;
  1. Query OK, 1 rows affected (0.09 sec)
  1. SELECT * FROM information_schema.resource_groups WHERE NAME ='rg1';
  1. Empty set (0.00 sec)

MySQL compatibility

MySQL also supports DROP RESOURCE GROUP, but TiDB does not support the FORCE parameter.

See also