复古 护眼 海天 深邃 暗黑 默认

SHOW RULES USED STORAGE UNIT

描述

SHOW RULES USED STORAGE UNIT 语法用于查询指定逻辑库中使用指定存储单元的规则。

语法

ShowRulesUsedStorageUnit ::=
  'SHOW' 'RULES' 'USED' 'STORAGE' 'UNIT' storageUnitName ('FROM' databaseName)?

storageUnitName ::=
  identifier

databaseName ::=
  identifier

返回值说明

说明
type 规则类型
name 规则名称

补充说明

  • 未指定 databaseName 时,默认是当前使用的 DATABASE。 如果也未使用 DATABASE 则会提示 No database selected

示例

  • 查询指定逻辑库中使用指定存储单元的规则
SHOW RULES USED STORAGE UNIT ds_1 FROM sharding_db;
mysql> SHOW RULES USED STORAGE UNIT ds_1 FROM sharding_db;
+---------------------+------------+
| type                | name       |
+---------------------+------------+
| readwrite_splitting | ms_group_0 |
| readwrite_splitting | ms_group_0 |
+---------------------+------------+
2 rows in set (0.01 sec)
  • 查询当前逻辑库中使用指定存储单元的规则
SHOW RULES USED STORAGE UNIT ds_1;
mysql> SHOW RULES USED STORAGE UNIT ds_1;
+---------------------+------------+
| type                | name       |
+---------------------+------------+
| readwrite_splitting | ms_group_0 |
| readwrite_splitting | ms_group_0 |
+---------------------+------------+
2 rows in set (0.01 sec)

保留字

SHOWRULESUSEDSTORAGEUNITFROM

相关链接