SHOW SHARDING TABLE REFERENCE RULE
Description
SHOW SHARDING TABLE REFERENCE RULE syntax is used to query specified sharding table reference rule in the specified logical database.
Syntax
ShowShardingBindingTableRules::=
'SHOW' 'SHARDING' 'TABLE' 'REFERENCE' ('RULE' ruleName | 'RULES') ('FROM' databaseName)?
ruleName ::=
identifier
databaseName ::=
identifierSupplement
- When
databaseNameis not specified, the default is the currently usedDATABASE. IfDATABASEis not used, No database selected will be prompted.
Return value description
| Columns | Descriptions |
|---|---|
| name | Sharding table reference rule name |
| sharding_table_reference | sharding table reference |
Example
- Query sharding table reference rules for the specified logical database
SHOW SHARDING TABLE REFERENCE RULES FROM sharding_db;mysql> SHOW SHARDING TABLE REFERENCE RULES FROM sharding_db;
+-------+--------------------------+
| name | sharding_table_reference |
+-------+--------------------------+
| ref_0 | t_a,t_b |
| ref_1 | t_c,t_d |
+-------+--------------------------+
2 rows in set (0.00 sec)- Query sharding table reference rules for the current logical database
SHOW SHARDING TABLE REFERENCE RULES;mysql> SHOW SHARDING TABLE REFERENCE RULES;
+-------+--------------------------+
| name | sharding_table_reference |
+-------+--------------------------+
| ref_0 | t_a,t_b |
| ref_1 | t_c,t_d |
+-------+--------------------------+
2 rows in set (0.00 sec)- Query specified sharding table reference rule for the specified logical database
SHOW SHARDING TABLE REFERENCE RULE ref_0 FROM sharding_db;mysql> SHOW SHARDING TABLE REFERENCE RULE FROM sharding_db;
+-------+--------------------------+
| name | sharding_table_reference |
+-------+--------------------------+
| ref_0 | t_a,t_b |
+-------+--------------------------+
1 row in set (0.00 sec)- Query specified sharding table reference rule for the current logical database
SHOW SHARDING TABLE REFERENCE RULE ref_0;mysql> SHOW SHARDING TABLE REFERENCE RULE ref_0;
+-------+--------------------------+
| name | sharding_table_reference |
+-------+--------------------------+
| ref_0 | t_a,t_b |
+-------+--------------------------+
1 row in set (0.00 sec)Reserved word
SHOW, SHARDING, TABLE, REFERENCE, RULE, RULES, FROM