SHOW SHARDING TABLE REFERENCE RULE

    语法

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

    返回值说明

    • 查询指定逻辑库中的分片表关联规则
    1. SHOW SHARDING TABLE REFERENCE RULES FROM sharding_db;
    1. mysql> SHOW SHARDING TABLE REFERENCE RULES FROM sharding_db;
    2. +-------+--------------------------+
    3. +-------+--------------------------+
    4. | ref_0 | t_a,t_b |
    5. | ref_1 | t_c,t_d |
    6. 2 rows in set (0.00 sec)
    • 查询当前逻辑库中的分片表关联规则
    1. mysql> SHOW SHARDING TABLE REFERENCE RULES;
    2. +-------+--------------------------+
    3. | name | sharding_table_reference |
    4. +-------+--------------------------+
    5. | ref_0 | t_a,t_b |
    6. | ref_1 | t_c,t_d |
    7. 2 rows in set (0.00 sec)
    • 查询指定逻辑库中的指定分片表关联规则
    1. SHOW SHARDING TABLE REFERENCE RULE ref_0 FROM sharding_db;
    • 查询当前逻辑库中的分片表关联规则
    1. SHOW SHARDING TABLE REFERENCE RULE ref_0;
    1. +-------+--------------------------+
    2. | name | sharding_table_reference |
    3. +-------+--------------------------+
    4. | ref_0 | t_a,t_b |
    5. +-------+--------------------------+
    6. 1 row in set (0.00 sec)

    保留字