SHOW SHARDING ALGORITHMS

Description

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

Syntax

  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;
  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 row in set (0.01 sec)

Reserved word

SHOW, SHARDING, ALGORITHMS, FROM