SHOW SHARDING TABLE NODES
描述
SHOW SHARDING TABLE NODES
语法用于查询指定逻辑库中的指定分片表的节点分布。
语法
语法 铁路图
ShowShardingTableNode::=
'SHOW' 'SHARDING' 'TABLE' 'NODES' tableName? ('FROM' databaseName)?
tableName ::=
identifier
databaseName ::=
identifier
补充说明
- 未指定
databaseName
时,默认是当前使用的DATABASE
。 如果也未使用DATABASE
则会提示No database selected
。
返回值说明
列 | 说明 |
---|---|
name | 分片规则名称 |
nodes | 分片节点 |
示例
- 查询指定逻辑库中指定分片表的节点分布
SHOW SHARDING TABLE NODES t_order_item FROM sharding_db;
mysql> SHOW SHARDING TABLE NODES t_order_item FROM sharding_db;
+--------------+------------------------------------------------------------------------------------------------------------+
| name | nodes |
+--------------+------------------------------------------------------------------------------------------------------------+
| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
+--------------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
- 查询当前逻辑库中指定分片表的节点分布
SHOW SHARDING TABLE NODES t_order_item;
mysql> SHOW SHARDING TABLE NODES t_order_item;
+--------------+------------------------------------------------------------------------------------------------------------+
| name | nodes |
+--------------+------------------------------------------------------------------------------------------------------------+
| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
+--------------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
- 查询指定逻辑库中所有分片表的节点分布
SHOW SHARDING TABLE NODES FROM sharding_db;
mysql> SHOW SHARDING TABLE NODES FROM sharding_db;
+--------------+------------------------------------------------------------------------------------------------------------+
| name | nodes |
+--------------+------------------------------------------------------------------------------------------------------------+
| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
+--------------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
- 查询当前逻辑库中所有分片表的节点分布
SHOW SHARDING TABLE NODES;
mysql> SHOW SHARDING TABLE NODES;
+--------------+------------------------------------------------------------------------------------------------------------+
| name | nodes |
+--------------+------------------------------------------------------------------------------------------------------------+
| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
+--------------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
保留字
SHOW
、SHARDING
、TABLE
、NODES
、FROM
相关链接
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .