SHOW DEFAULT SHARDING STRATEGY
Description
The SHOW DEFAULT SHARDING STRATEGY
syntax is used to query default sharding strategy in specified database.
Syntax
Grammar Railroad diagram
ShowDefaultShardingStrategy::=
'SHOW' 'DEFAULT' 'SHARDING' 'STRATEGY' ('FROM' databaseName)?
databaseName ::=
identifier
Supplement
- When
databaseName
is not specified, the default is the currently usedDATABASE
. IfDATABASE
is not used,No database selected
will be prompted.
Return value description
Column | Description |
---|---|
name | Sharding strategy scope |
type | Sharding strategy type |
sharding_column | Sharding column |
sharding_algorithm_name | Sharding algorithm name |
sharding_algorithm_type | Sharding algorithm type |
sharding_algorithm_props | Sharding algorithm properties |
Example
- Query default sharding strategy in specified database.
SHOW DEFAULT SHARDING STRATEGY FROM sharding_db;
mysql> SHOW DEFAULT SHARDING STRATEGY FROM sharding_db;
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
2 rows in set (0.00 sec)
- Query default sharding strategy in current database.
SHOW DEFAULT SHARDING STRATEGY;
mysql> SHOW DEFAULT SHARDING STRATEGY;
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
2 rows in set (0.00 sec)
Reserved word
SHOW
, DEFAULT
, SHARDING
, STRATEGY
, FROM
Related links
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .