SHOW SHARDING ALGORITHMS

Description

The SHOW SHARDING ALGORITHMS syntax is used to query the sharding algorithms in the specified database.

Syntax

Grammar Railroad diagram

  1. ShowShardingAlgorithms::=
  2. 'SHOW' 'SHARDING' 'ALGORITHMS' ('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

ColumnDescription
nameSharding algorithm name
typeSharding algorithm type
propsSharding algorithm properties

Example

  • Query the sharding table algorithms of the specified logical database
  1. SHOW SHARDING ALGORITHMS FROM sharding_db;
  1. mysql> SHOW SHARDING ALGORITHMS FROM sharding_db;
  2. +-------------------------+--------+-----------------------------------------------------+
  3. | name | type | props |
  4. +-------------------------+--------+-----------------------------------------------------+
  5. | t_order_inline | INLINE | algorithm-expression=t_order_${order_id % 2} |
  6. | t_order_item_inline | INLINE | algorithm-expression=t_order_item_${order_id % 2} |
  7. +-------------------------+--------+-----------------------------------------------------+
  8. 2 rows in set (0.01 sec)
  • Query the sharding table algorithms of the current logical database
  1. SHOW SHARDING ALGORITHMS;
  1. mysql> SHOW SHARDING ALGORITHMS;
  2. +-------------------------+--------+-----------------------------------------------------+
  3. | name | type | props |
  4. +-------------------------+--------+-----------------------------------------------------+
  5. | t_order_inline | INLINE | algorithm-expression=t_order_${order_id % 2} |
  6. | t_order_item_inline | INLINE | algorithm-expression=t_order_item_${order_id % 2} |
  7. +-------------------------+--------+-----------------------------------------------------+
  8. 2 rows in set (0.01 sec)

Reserved word

SHOW, SHARDING, ALGORITHMS, FROM