DROP RESOURCE GROUP

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

语法图

DropResourceGroupStmt
DROPRESOURCEGROUPIfExistsResourceGroupName
IfExists
IFEXISTS
ResourceGroupName
IdentifierDEFAULT

示例

删除名为 rg1 的资源组:

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

MySQL 兼容性

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

另请参阅

文档内容是否有帮助?