SHOW SHARDING TABLE NODES

    Syntax

    • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.

    Return value description

    • Query sharding table nodes for specified table in the specified logical database
    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. +--------------+------------------------------------------------------------------------------------------------------------+
    6. 1 row in set (0.00 sec)
    • Query sharding table nodes for specified table in the current logical database
    1. mysql> SHOW SHARDING TABLE NODES t_order_item;
    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
    • Query sharding table nodes for all tables in the specified logical database
    1. SHOW SHARDING TABLE NODES FROM sharding_db;
    • Query sharding table nodes for all tables in the current logical database
    1. SHOW SHARDING TABLE NODES;
    1. mysql> SHOW SHARDING TABLE NODES;
    2. +--------------+------------------------------------------------------------------------------------------------------------+
    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. +--------------+------------------------------------------------------------------------------------------------------------+

    Reserved word