SHOW SHARDING TABLE RULES USED KEY GENERATOR
语法用于查询指定逻辑库中使用指定分片主键生成器的分片规则。
ShowShardingTableRulesUsedKeyGenerator::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'KEY' 'GENERATOR' keyGeneratorName ('FROM' databaseName)?
keyGeneratorName ::=
identifier
databaseName ::=
identifier
databaseName
时,默认是当前使用的 DATABASE
。 如果也未使用 DATABASE
则会提示 No database selected
。列 | 说明 |
---|---|
type | 分片规则类型 |
name | 分片规则名称 |
SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator FROM test1;
mysql> SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator FROM test1;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.00 sec)
SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator;
mysql> SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.01 sec)
SHOW
、SHARDING
、TABLE
、USED
、KEY
、GENERATOR
、FROM