SHOW RULES USED STORAGE UNIT

描述

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

语法

语法 铁路图

  1. ShowRulesUsedStorageUnit ::=
  2. 'SHOW' 'RULES' 'USED' 'STORAGE' 'UNIT' storageUnitName ('FROM' databaseName)?
  3. storageUnitName ::=
  4. identifier
  5. databaseName ::=
  6. identifier

返回值说明

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

补充说明

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

示例

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

保留字

SHOWRULESUSEDSTORAGEUNITFROM

相关链接