SHOW SHARDING TABLE REFERENCE RULES

Description

SHOW SHARDING TABLE REFERENCE RULES syntax is used to query sharding tables with reference relationships in the specified logical database.

Syntax

  1. ShowShardingBindingTableRules::=
  2. 'SHOW' 'SHARDING' 'TABLE' 'REFERENCE' 'RULES'('FROM' databaseName)?
  3. databaseName ::=
  4. identifier

Supplement

  • 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

ColumnsDescriptions
nameSharding table reference rule name
sharding_table_referencesharding table reference

Example

  • Query sharding table reference rules for the specified logical database
  1. SHOW SHARDING TABLE REFERENCE RULES FROM test1;
  1. mysql> SHOW SHARDING TABLE REFERENCE RULES FROM test1;
  2. +-------+--------------------------+
  3. | name | sharding_table_reference |
  4. +-------+--------------------------+
  5. | ref_0 | t_a,t_b |
  6. | ref_1 | t_c,t_d |
  7. +-------+--------------------------+
  8. 2 rows in set (0.00 sec)
  • Query sharding table reference rules for the current logical database
  1. SHOW SHARDING TABLE REFERENCE RULES;
  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. +-------+--------------------------+
  8. 2 rows in set (0.00 sec)

Reserved word

SHOW, SHARDING, TABLE, REFERENCE, RULES, FROM