SHOW SHARDING TABLE NODES

    语法

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

    返回值说明

    • 查询指定逻辑库中指定分片表的节点分布
    1. SHOW SHARDING TABLE NODES t_order_item FROM sharding_db;
    1. mysql> SHOW SHARDING TABLE NODES t_order_item FROM sharding_db;
    2. | name | nodes |
    3. +--------------+------------------------------------------------------------------------------------------------------------+
    4. | 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 |
    5. 1 row in set (0.00 sec)
    • 查询当前逻辑库中指定分片表的节点分布
    1. mysql> SHOW SHARDING TABLE NODES t_order_item;
    2. +--------------+------------------------------------------------------------------------------------------------------------+
    3. | name | nodes |
    4. +--------------+------------------------------------------------------------------------------------------------------------+
    5. | 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 |
    6. 1 row in set (0.00 sec)
    • 查询指定逻辑库中所有分片表的节点分布
    1. SHOW SHARDING TABLE NODES FROM sharding_db;
    • 查询当前逻辑库中所有分片表的节点分布
    1. SHOW SHARDING TABLE NODES;
    1. +--------------+------------------------------------------------------------------------------------------------------------+
    2. | name | nodes |
    3. +--------------+------------------------------------------------------------------------------------------------------------+
    4. | 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 |
    5. +--------------+------------------------------------------------------------------------------------------------------------+

    保留字