DROP RESOURCE GROUP

DROP RESOURCE GROUP 语句用于在当前所选数据库中删除资源组。

语法图

DropResourceGroupStmt

DROP RESOURCE GROUP - 图1

IfExists

DROP RESOURCE GROUP - 图2

ResourceGroupName

DROP RESOURCE GROUP - 图3

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

DROP RESOURCE GROUP - 图4

注意

  • DROP RESOURCE GROUP 语句只能在全局变量 tidb_enable_resource_control 设置为 ON 时才能执行。
  • default 资源组为系统保留的资源组,不支持删除。

示例

删除名为 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 |
  3. +------+------------+----------+-----------+
  4. | rg1 | 500 | MEDIUM | YES |
  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 兼容性

MySQL 也支持 DROP RESOURCE GROUP,但 TiDB 不支持 FORCE 参数。

另请参阅