ALTER SHARDING TABLE RULE
tableDefinition
is defined for standard sharding table rule;autoTableDefinition
is defined for auto sharding table rule. For standard sharding rules and auto sharding rule, refer to ;- use standard sharding table rule:
DATANODES
can only use resources that have been added to the current database, and can only use INLINE expressions to specify required resources;DATABASE_STRATEGY
,TABLE_STRATEGY
are the database sharding strategy and the table sharding strategy, which are optional, and the default strategy is used when not configured;- The attribute
TYPE
instrategyDefinition
is used to specify the type of Sharding Algorithm, currently only supportsSTANDARD
,COMPLEX
. UsingCOMPLEX
requires specifying multiple sharding columns withSHARDING_COLUMNS
.
- use auto sharding table rule:
STORAGE_UNITS
can only use storage units that have been registered to the current database, and the required storage units can be specified by enumeration or INLINE expression;
- is the sharding algorithm type, please refer to ;
- The auto-generated algorithm naming rule is
tableName
_strategyType
_shardingAlgorithmType
; - The auto-generated primary key strategy naming rule is
tableName
_strategyType
; KEY_GENERATE_STRATEGY
is used to specify the primary key generation strategy, which is optional. For the primary key generation strategy, please refer to Distributed Primary Key.AUDIT_STRATEGY
is used to specify the sharding audit strategy, which is optional. For the sharding audit generation strategy, please refer to .