Logo
Sharding Table

Sharding Table #

SyntaxDescriptionType
CREATE SHARDING TABLE RULE shardingTableRuleDefinition [, shardingTableRuleDefinition] …Create sharding ruleRDL
ALTER SHARDING TABLE RULE shardingTableRuleDefinition [, shardingTableRuleDefinition] …Modify sharding ruleRDL
DROP SHARDING TABLE RULE tableName [, tableName] …Delete sharding ruleRDL
SHOW SHARDING TABLE tableRule RULES [FROM databaseName]View sharding ruleRQL
SHOW SHARDING TABLE NODESView the sharding rules where the sharding table in the logic database is locatedRQL
COUNT SHARDING RULECount the number of sharding rules, this syntax will be deprecated in subsequent versionsRQL
DROP SHARDING ALGORITHM algorithmName [, algorithmName] …Deleting sharding algorithms individually cannot delete in used algorithmsRDL
SHOW SHARDING ALGORITHMS [FROM databaseName]View sharding algorithm detailsRQL
SHOW UNUSED SHARDING ALGORITHMS [FROM databaseName]View unused sharding algorithmsRQL
SHOW SHARDING TABLE RULES USED ALGORITHM shardingAlgorithmName [FROM databaseName]View tables using the specified sharding algorithmRQL
DROP SHARDING KEY GENERATOR [IF EXISTS] keyGeneratorName [, keyGeneratorName] …Delete the distributed primary key generation algorithmRDL
SHOW SHARDING KEY GENERATORS [FROM databaseName]View unused distributed primary key generation algorithmRQL
SHOW UNUSED SHARDING KEY GENERATORS [FROM databaseName]View unused distributed primary key generation algorithmRQL
SHOW SHARDING TABLE RULES USED KEY GENERATOR keyGeneratorName [FROM databaseName]View tables using the specified algorithmRQL
CREATE DEFAULT SHARDING shardingScope STRATEGY (shardingStrategy)Create default sharding strategy for the specified sharding scopeRDL
ALTER DEFAULT SHARDING shardingScope STRATEGY (shardingStrategy)Modify default sharding strategy for the specified sharding scopeRDL
DROP DEFAULT SHARDING shardingScope STRATEGYDelete default sharding strategy for the specified sharding scopeRDL
SHOW DEFAULT SHARDING STRATEGYView details of the default sharding strategyRQL
SHOW AUTO_RESHARDING (STRATEGY tableName \STRATEGIES)View details of auto-resharding strategy
CREATE DEFAULT AUTO_RESHARDING STRATEGYCreate default auto-resharding strategyRDL
ALTER DEFAULT AUTO_RESHARDING STRATEGYModify default auto-resharding strategyRDL
DROP DEFAULT AUTO_RESHARDING STRATEGYDelete default auto-resharding strategyRDL
SHOW DEFAULT AUTO_RESHARDING STRATEGYView details of the default auto-resharding strategyRQL

1. Create Sharding Rule #

CREATE SHARDING TABLE RULE shardingTableRuleDefinition [, shardingTableRuleDefinition] ...
shardingTableRuleDefinition:
    shardingAutoTableRule | shardingTableRule

shardingAutoTableRule:
    tableName(storageUnits, shardingColumn, algorithmDefinition [, keyGenerateDefinition] [, auditDeclaration])

shardingTableRule:
    tableName(dataNodes [, databaseStrategy] [, tableStrategy] [, keyGenerateDefinition] [, auditDeclaration])

storageUnits:
    STORAGE_UNITS(storageUnit [, storageUnit] ...)

dataNodes:
    DATANODES(dataNode [, dataNode] ...)

storageUnit:
    storageUnitName | inlineExpression

dataNode:
    dataNodeName | inlineExpression

shardingColumn:
    SHARDING_COLUMN=columnName

algorithmDefinition:
    TYPE(NAME=shardingAlgorithmType [, PROPERTIES([algorithmProperties])])

keyGenerateDefinition:
    KEY_GENERATE_STRATEGY(COLUMN=columnName, strategyDefinition)
    
auditDeclaration:
    auditDefinition | auditStrategy

auditDefinition:
    AUDIT_STRATEGY([(singleAuditDefinition),(singleAuditDefinition)], ALLOW_HINT_DISABLE=true)
    
singleAuditDefinition:
    NAME=auditor1, algorithmDefinition
    
auditStrategy:
    AUDIT_STRATEGY(AUDITORS=[auditor1,auditor2], ALLOW_HINT_DISABLE=true)

Parameter Explanation

  • STORAGE_UNITS needs to use storage units managed by RDL
  • shardingAlgorithmType specify auto sharding algorithm type, please refer to Auto sharding algorithm
  • keyGenerateStrategyType specify key generator strategy, please refer to Key generator
  • auditorAlgorithmType specify sharding audit strategy, please refer to Sharding audit
  • Duplicate tableName will not be created
  • shardingAlgorithm can be reused by different Sharding Table Rule, so when executing DROP SHARDING TABLE RULE, the corresponding shardingAlgorithm will not be removed
  • To remove shardingAlgorithm, please execute DROP SHARDING ALGORITHM
  • The algorithm naming rule automatically generated after creating the sharding rule is tableName _ strategyType _ algorithmType;
  • The naming rule of the primary key strategy automatically generated after creating the sharding rule is tableName _ `strategyType;
  • Sharding Table Rule supports both Auto Table and Table at the same time. The two types are different in syntax.
  • executing CREATE SHARDING TABLE RULE,a new sharding algorithm will be created automatically. The algorithm naming rule is tableName_scope_shardingAlgorithmType,such as t_order_database_inline
  • When DATABASE_STRATEGY is “NONE”, no sharding database strategy

Example

Create sharding table rule use default sharding database strategy

CREATE SHARDING TABLE RULE t_order (
STORAGE_UNITS(ds_0,ds_1),
SHARDING_COLUMN=order_id,TYPE(NAME="hash_mod",PROPERTIES("sharding-count"="4")),
KEY_GENERATE_STRATEGY(COLUMN=another_id,TYPE(NAME="snowflake"))
);

Create sharding table rule with none sharding database strategy

CREATE SHARDING TABLE RULE t_item (
DATANODES("ds_0.t_item_${0..1}"),
DATABASE_STRATEGY(TYPE="NONE"),
TABLE_STRATEGY(TYPE="standard",SHARDING_COLUMN=order_id,SHARDING_ALGORITHM(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="t_item_${order_id % 2}"))))
);

2. Modify Sharding Rule #

ALTER SHARDING TABLE RULE shardingTableRuleDefinition [, shardingTableRuleDefinition] ...

shardingTableRuleDefinition:
    shardingAutoTableRule | shardingTableRule

shardingAutoTableRule:
    tableName(storageUnits, shardingColumn, algorithmDefinition [, keyGenerateDefinition] [, auditDeclaration])

shardingTableRule:
    tableName(dataNodes [, databaseStrategy] [, tableStrategy] [, keyGenerateDefinition] [, auditDeclaration])

storageUnits:
    STORAGE_UNITS(storageUnit [, storageUnit] ...)

dataNodes:
    DATANODES(dataNode [, dataNode] ...)

storageUnit:
    storageUnitName | inlineExpression

dataNode:
    dataNodeName | inlineExpression

shardingColumn:
    SHARDING_COLUMN=columnName

algorithmDefinition:
    TYPE(NAME=shardingAlgorithmType [, PROPERTIES([algorithmProperties])])

keyGenerateDefinition:
    KEY_GENERATE_STRATEGY(COLUMN=columnName, strategyDefinition)
    
auditDeclaration:
    auditDefinition | auditStrategy

auditDefinition:
    AUDIT_STRATEGY([(singleAuditDefinition),(singleAuditDefinition)], ALLOW_HINT_DISABLE=true)
    
singleAuditDefinition:
    NAME=auditor1, algorithmDefinition
    
auditStrategy:
    AUDIT_STRATEGY(AUDITORS=[auditor1,auditor2], ALLOW_HINT_DISABLE=true)

Parameter Explanation

  • STORAGE_UNITS needs to use storage units managed by RDL
  • shardingAlgorithmType specify auto sharding algorithm type, please refer to Auto sharding algorithm
  • keyGenerateStrategyType specify key generator strategy, please refer to Key generator
  • auditorAlgorithmType specify sharding audit strategy, please refer to Sharding audit
  • Duplicate tableName will not be created
  • shardingAlgorithm can be reused by different Sharding Table Rule, so when executing DROP SHARDING TABLE RULE, the corresponding shardingAlgorithm will not be removed
  • To remove shardingAlgorithm, please execute DROP SHARDING ALGORITHM
  • The algorithm naming rule automatically generated after creating the sharding rule is tableName _ strategyType _ algorithmType;
  • The naming rule of the primary key strategy automatically generated after creating the sharding rule is tableName _ `strategyType;
  • Sharding Table Rule supports both Auto Table and Table at the same time. The two types are different in syntax.
  • executing CREATE SHARDING TABLE RULE,a new sharding algorithm will be created automatically. The algorithm naming rule is tableName_scope_shardingAlgorithmType,such as t_order_database_inline
  • When DATABASE_STRATEGY is “NONE”, no sharding database strategy

Example

  ALTER SHARDING TABLE RULE t_order (
STORAGE_UNITS(ds_0,ds_1,ds_2,ds_3),
SHARDING_COLUMN=order_id,TYPE(NAME="hash_mod",PROPERTIES("sharding-count"="16")),
KEY_GENERATE_STRATEGY(COLUMN=another_id,TYPE(NAME="snowflake"))
);

3. Delete Sharding Rule #

DROP SHARDING TABLE RULE t_order_item;

Example

Delete sharding rule named t_order_item

DROP SHARDING TABLE RULE t_order_item;

4. View Sharding rule #

SHOW SHARDING TABLE tableRule | RULES [FROM databaseName]

Example

View all sharding table rule in logical database

mysql> SHOW SHARDING TABLE RULES;
+--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
| table        | actual_data_nodes               | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                       | key_generate_column | key_generator_type | key_generator_props | auditor_types | allow_hint_disable |+--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
| t_order      | ds_${0..1}.t_order_${0..1}      |                   | INLINE               | user_id                | INLINE                        | algorithm-expression:ds_${user_id % 2} | INLINE            | order_id            | INLINE                     | algorithm-expression:t_order_${order_id % 2}      | order_id          | SNOWFLAKE        |                   | DML_SHARDING_CONDITIONS    |true      || t_order_item | ds_${0..1}.t_order_item_${0..1} |                   | INLINE               | user_id                | INLINE                        | algorithm-expression:ds_${user_id % 2} | INLINE            | order_id            | INLINE                     | algorithm-expression:t_order_item_${order_id % 2} | order_item_id     | SNOWFLAKE        |                   |                            |          || t2           |                                 | ds_0,ds_1         |                      |                        |                               |                                        | mod               | id                  | mod                        | sharding-count:10                                 |                   |                  |                   |                            |          |+--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
3 rows in set (0.02 sec)

View specified sharding table rule in logical database

mysql> SHOW SHARDING TABLE RULE t_order;
+---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
| table   | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                  | key_generate_column | key_generator_type | key_generator_props | auditor_types | allow_hint_disable |+---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
| t_order | ds_${0..1}.t_order_${0..1} |                   | INLINE               | user_id                | INLINE                        | algorithm-expression:ds_${user_id % 2} | INLINE            | order_id            | INLINE                     | algorithm-expression:t_order_${order_id % 2} | order_id          | SNOWFLAKE        |                   | DML_SHARDING_CONDITIONS    |true      | 
+---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
1 row in set (0.01 sec)

Output Description

ColumnDescription
tableLogical table name
actual_data_nodesActual data node
actual_data_sourcesActual data source (Displayed when creating rules by RDL)
database_strategy_typeDatabase sharding strategy type
database_sharding_columnDatabase sharding column
database_sharding_algorithm_typeDatabase sharding algorithm type
database_sharding_algorithm_propsDatabase sharding algorithm properties
table_strategy_typeTable sharding strategy type
table_sharding_columnTable sharding column
table_sharding_algorithm_typeTable sharding algorithm type
table_sharding_algorithm_propsTable sharding algorithm properties
key_generate_columnSharding key generator column
key_generator_typeSharding key generator type
key_generator_propsSharding key generator properties
auditor_typesSharding auditor types
allow_hint_disableEnable or disable sharding audit hint

5. View the sharding rules where the sharding table in the logic database is located #

SHOW SHARDING TABLE NODES;

Parameter Explanation

None

Example

mysql> SHOW SHARDING TABLE NODES;
+---------+----------------------------------------------------------------+
| name    | nodes                                                          |
+---------+----------------------------------------------------------------+
| t_order | ds_0.t_order_0, ds_1.t_order_1, ds_0.t_order_2, ds_1.t_order_3 |
+---------+----------------------------------------------------------------+
1 row in set (0.02 sec)

Output Description

ColumnDescription
nameSharding rule name
nodesSharding nodes

6. Individually Delete The Sharding Algorithm #

DROP SHARDING ALGORITHM algorithmName [, algorithmName] ...

Example

Delete sharding algorithm named t_order_hash_mod

DROP SHARDING ALGORITHM t_order_hash_mod;

7. View Detail Of Sharding Algorithms #

SHOW SHARDING ALGORITHMS;

Parameter Explanation

None

Example

mysql> SHOW SHARDING ALGORITHMS;
+-------------------------+--------+-----------------------------------------------------+
| name                    | type   | props                                               |+-------------------------+--------+-----------------------------------------------------+
| t_order_inline          | INLINE | algorithm-expression=t_order_${order_id % 2}        || t_order_item_inline     | INLINE | algorithm-expression=t_order_item_${order_id % 2}   |+-------------------------+--------+-----------------------------------------------------+
2 row in set (0.01 sec)

Output Description

ColumnDescription
nameSharding algorithm name
typeSharding algorithm type
propsSharding algorithm properties

8. View Unused Sharding Algorithm #

SHOW UNUSED SHARDING ALGORITHMS;

Parameter Explanation

None

Example

mysql> SHOW UNUSED SHARDING ALGORITHMS;
+---------------+--------+-----------------------------------------------------+
| name          | type   | props                                               |+---------------+--------+-----------------------------------------------------+
| t1_inline     | INLINE | algorithm-expression=t_order_${order_id % 2}        |+---------------+--------+-----------------------------------------------------+
1 row in set (0.01 sec)

Output Description

ColumnDescription
nameSharding algorithm name
typeSharding algorithm type
propsSharding algorithm properties

9. View Tables Using The Specified Sharding Algorithm #

SHOW SHARDING TABLE RULES USED ALGORITHM shardingAlgorithmName [FROM databaseName]

Example

mysql> SHOW SHARDING TABLE RULES USED ALGORITHM t_order_inline;
+-------+---------+
| type  | name    |
+-------+---------+
| table | t_order |
1 row in set (0.01 sec)

Output Description

ColumnDescription
typeSharding algorithm type
nameSharding algorithm name (same as table name)

10. Delete Distributed Primary Key Generation Algorithm #

DROP SHARDING KEY GENERATOR [IF EXISTS] keyGeneratorName [, keyGeneratorName] ...

Example

DROP SHARDING KEY GENERATOR snowflake_key_generator;

11. View Distributed Primary Key Generation Algorithm #

SHOW SHARDING KEY GENERATORS;

Parameter Explanation

None

Example

  mysql> SHOW SHARDING KEY GENERATORS;
+------------------------+-----------+-----------------+
| name                   | type      | props           |
+------------------------+-----------+-----------------+
| t_order_snowflake      | snowflake |                 |
| t_order_item_snowflake | snowflake |                 |
| uuid_key_generator     | uuid      |                 |
+------------------------+-----------+-----------------+
3 row in set (0.01 sec)

Output Description

ColumnDescription
nameKey generator name
typeKey generator type
propsKey generator properties

12. View Unused Key Generation Algorithm #

SHOW UNUSED SHARDING KEY GENERATORS;

Parameter Explanation

None

Example

mysql> SHOW UNUSED SHARDING KEY GENERATORS;
+------------------------+-----------+-----------------+
| name                   | type      | props           |
+------------------------+-----------+-----------------+
| dml_audit              | uuid      |                 |
+------------------------+-----------+-----------------+
1 row in set (0.01 sec)

Output Description

ColumnDescription
nameKey generator name
typeKey generator type
propsKey generator properties

13. View Tables Using Specified Key Generation Algorithm #

SHOW SHARDING TABLE RULES USED KEY GENERATOR keyGeneratorName [FROM databaseName]

Example

mysql> SHOW SHARDING TABLE RULES USED KEY GENERATOR t_order_snowflake;
+-------+---------+
| type  | name    |
+-------+---------+
| table | t_order |
+-------+---------+
1 row in set (0.01 sec)

Output Description

ColumnDescription
typeSharding algorithm name(sharding database algorithm or sharding table algorithm)
nameSharding rule name

14. Create Default Sharding Database Sharding Table Strategy #

CREATE DEFAULT SHARDING shardingScope STRATEGY (shardingStrategy)

shardingScope:
    DATABASE | TABLE

databaseStrategy:
    DATABASE_STRATEGY(shardingStrategy)

tableStrategy:
    TABLE_STRATEGY(shardingStrategy)

shardingStrategy:
    TYPE=strategyType, shardingColumn, shardingAlgorithm

shardingColumn:
    SHARDING_COLUMN=columnName

shardingAlgorithm:
    SHARDING_ALGORITHM(algorithmDefinition)

strategyDefinition:
    TYPE(NAME=keyGenerateStrategyType [, PROPERTIES([algorithmProperties])])

Parameter Explanation

  • strategyType specify sharding strategy;
  • When execute CREATE DEFAULT SHARDING STRATEGY, A new sharding algorithm will also be created automatically, and the algorithm naming rules are default_scope_shardingAlgorithmType, such as default_database_inline.

Example

CREATE DEFAULT SHARDING DATABASE STRATEGY (
TYPE="standard",SHARDING_COLUMN=order_id,SHARDING_ALGORITHM(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="ds_${order_id % 2}")))
);

15. Modify Default Sharding Database Sharding Table Strategy #

ALTER DEFAULT SHARDING shardingScope STRATEGY (shardingStrategy)

shardingScope:
    DATABASE | TABLE

databaseStrategy:
    DATABASE_STRATEGY(shardingStrategy)

tableStrategy:
    TABLE_STRATEGY(shardingStrategy)

shardingStrategy:
    TYPE=strategyType, shardingColumn, shardingAlgorithm

shardingColumn:
    SHARDING_COLUMN=columnName

shardingAlgorithm:
    SHARDING_ALGORITHM(algorithmDefinition)

strategyDefinition:
    TYPE(NAME=keyGenerateStrategyType [, PROPERTIES([algorithmProperties])])

Parameter Explanation

  • strategyType specify sharding strategy;
  • When execute CREATE DEFAULT SHARDING STRATEGY, A new sharding algorithm will also be created automatically, and the algorithm naming rules are default_scope_shardingAlgorithmType, such as default_database_inline.

Example

ALTER DEFAULT SHARDING DATABASE STRATEGY (
TYPE="standard",SHARDING_COLUMN=order_id,SHARDING_ALGORITHM(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="ds_${order_id % 2}")))
);

16. Delete Default Sharding Database Sharding Table Strategy #

DROP DEFAULT SHARDING shardingScope STRATEGY

shardingScope:
    DATABASE | TABLE

Example

DROP DEFAULT SHARDING DATABASE STRATEGY;

17. View Default Sharding Database Sharding Table Strategy #

SHOW DEFAULT SHARDING STRATEGY;

Parameter Explanation

None

Example

mysql> SHOW DEFAULT SHARDING STRATEGY ;

+----------+---------+--------------------+-------------------------+-------------------------+------------------------------------------+
| name     | type    | sharding_column    | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props                 |
+----------+---------+--------------------+-------------------------+-------------------------+------------------------------------------+
| TABLE    | NONE    |                    |                         |                         |                                          |
| DATABASE | STANDARD| order_id           | database_inline         | INLINE                  | {algorithm-expression=ds_${user_id % 2}} |
+----------+---------+--------------------+-------------------------+-------------------------+------------------------------------------+
2 rows in set (0.07 sec)

Output Description

ColumnDescription
nameStrategy name
typeSharding strategy type
sharding_columnSharding key
sharding_algorithm_nameSharding algorithm name
sharding_algorithm_typeSharding algorithm type
sharding_algorithm_propsSharding algorithm properties

18. View Details of Default Auto-resharding Strategy #

 SHOW AUTO_RESHARDING (STRATEGY tableName \| STRATEGIES)

Example

 SHOW AUTO_RESHARDING STRATEGIES;
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+
 | table                 | type     | algorithm_name                                                      | algorithm_type                     | algorithm_props                           |
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+
 | t_order_auto_interval | matching | t_order_auto_interval_matching_interval_upper_time_high_waterline_0 | INTERVAL_UPPER_TIME_HIGH_WATERLINE | remaining-seconds-until-upper-time=864000 |
 | t_order_auto_interval | action   | t_order_auto_interval_action_scale_sharding                         | SCALE_SHARDING                     | amount=30,operation-type=ADD              |
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+
 SHOW AUTO_RESHARDING STRATEGY t_order_auto_interval ;
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+
 | table                 | type     | algorithm_name                                                      | algorithm_type                     | algorithm_props                           |
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+
 | t_order_auto_interval | matching | t_order_auto_interval_matching_interval_upper_time_high_waterline_0 | INTERVAL_UPPER_TIME_HIGH_WATERLINE | remaining-seconds-until-upper-time=864000 |
 | t_order_auto_interval | action   | t_order_auto_interval_action_scale_sharding                         | SCALE_SHARDING                     | amount=30,operation-type=ADD              |
 +-----------------------+----------+---------------------------------------------------------------------+------------------------------------+-------------------------------------------+

19. Create Default Auto-resharding Strategy #

CREATE DEFAULT AUTO_RESHARDING STRATEGY

Example

CREATE DEFAULT AUTO_RESHARDING STRATEGY(
  MATCHING_ALGORITHM(
  TYPE(NAME="INTERVAL_UPPER_TIME_HIGH_WATERLINE",PROPERTIES("remaining-seconds-until-upper-time"=86400))
  ),
  ACTION_ALGORITHM(TYPE(NAME="SCALE_SHARDING",PROPERTIES("operation-type"="ADD","amount"=2)))
);

20. Modify Default Auto-resharding Strategy #

ALTER DEFAULT AUTO_RESHARDING STRATEGY

Example

ALTER DEFAULT AUTO_RESHARDING STRATEGY(
  MATCHING_ALGORITHM(
  TYPE(NAME="INTERVAL_UPPER_TIME_HIGH_WATERLINE",PROPERTIES("remaining-seconds-until-upper-time"=86400))
  ),
  ACTION_ALGORITHM(TYPE(NAME="SCALE_SHARDING",PROPERTIES("operation-type"="ADD","amount"=2)))
);

21. Delete Default Auto-resharding Strategy #

DROP DEFAULT AUTO_RESHARDING STRATEGY

Example

DROP DEFAULT AUTO_RESHARDING STRATEGY;

22. View Details of Default Auto-resharding Strategy #

SHOW DEFAULT AUTO_RESHARDING STRATEGY
SHOW DEFAULT AUTO_RESHARDING STRATEGY;
+----------+---------------------------------------+------------------------------------+------------------------------------------+
| type     | algorithm_name                        | algorithm_type                     | algorithm_props                          |
+----------+---------------------------------------+------------------------------------+------------------------------------------+
| matching | default_matching_matching_algorithm_0 | INTERVAL_UPPER_TIME_HIGH_WATERLINE | remaining-seconds-until-upper-time=86400 |
| action   | default_action_action_algorithm       | SCALE_SHARDING                     | amount=2,operation-type=ADD              |
+----------+---------------------------------------+------------------------------------+------------------------------------------+