You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/08/08 08:14:09 UTC
[shardingsphere] branch master updated: Add `ALTER SHARDING TABLE RULE` docs. (#19896)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 227abb4b948 Add `ALTER SHARDING TABLE RULE` docs. (#19896)
227abb4b948 is described below
commit 227abb4b9480285ee94e2fd9ae469a8dbf538fdf
Author: Jieker <ji...@163.com>
AuthorDate: Mon Aug 8 16:14:03 2022 +0800
Add `ALTER SHARDING TABLE RULE` docs. (#19896)
* Add `ALTER SHARDING TABLE RULE` docs.
* Change weight.
* add a line
---
.../rdl/resource-definition/alter-resource.cn.md | 2 +-
.../sharding/alter-sharding-table-rule.cn.md | 164 +++++++++++++++++++
.../sharding/alter-sharding-table-rule.en.md | 173 +++++++++++++++++++++
.../create-default-sharding-strategy.cn.md | 2 +-
.../create-default-sharding-strategy.en.md | 2 +-
.../sharding/create-sharding-algorithm.cn.md | 2 +-
.../sharding/create-sharding-algorithm.en.md | 2 +-
.../create-sharding-binding-table-rule.cn.md | 2 +-
.../create-sharding-binding-table-rule.en.md | 2 +-
.../create-sharding-broadcast-table-rule.cn.md | 2 +-
.../create-sharding-broadcast-table-rule.en.md | 2 +-
.../sharding/create-sharding-key-generator.cn.md | 2 +-
.../sharding/create-sharding-key-generator.en.md | 2 +-
.../reference/distsql/syntax/reserved-word.cn.md | 2 +-
14 files changed, 349 insertions(+), 12 deletions(-)
diff --git a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.cn.md b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.cn.md
index b1ab70c95cb..eabdc1015be 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.cn.md
@@ -1,6 +1,6 @@
+++
title = "ALTER RESOURCE"
-weight = 4
+weight = 3
+++
### 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.cn.md
new file mode 100644
index 00000000000..1869b7b4b4e
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.cn.md
@@ -0,0 +1,164 @@
++++
+title = "ALTER SHARDING TABLE RULE"
+weight = 3
++++
+
+## 描述
+
+`ALTER SHARDING TABLE RULE` 语法用于修改当前所选逻辑库的分片规则
+
+### 语法定义
+
+```sql
+AlterShardingTableRule ::=
+ 'ALTER' 'SHARDING' 'TABLE' 'RULE' ( tableDefinition | autoTableDefinition ) ( ',' ( tableDefinition | autoTableDefinition ) )*
+
+tableDefinition ::=
+ tableName '(' 'DATANODES' '(' dataNode ( ',' dataNode )* ')' ( ',' 'DATABASE_STRATEGY' '(' strategyDefinition ')' )? ( ',' 'TABLE_STRATEGY' '(' strategyDefinition ')' )? ( ',' 'KEY_GENERATE_STRATEGY' '(' keyGenerateStrategyDefinition ')' )? ')'
+
+autoTableDefinition ::=
+ tableName '(' 'RESOURCES' '(' resourceName ( ',' resourceName )* ')' ',' 'SHARDING_COLUMN' '=' columnName ',' algorithmDefinition ( ',' 'KEY_GENERATE_STRATEGY' '(' keyGenerateStrategyDefinition ')' )?')'
+
+strategyDefinition ::=
+ 'TYPE' '=' strategyType ',' ( 'SHARDING_COLUMN' | 'SHARDING_COLUMNS' ) '=' columnName ',' algorithmDefinition
+
+keyGenerateStrategyDefinition ::=
+ 'KEY_GENERATE_STRATEGY' '(' 'COLUMN' '=' columnName ',' ( 'KEY_GENERATOR' '=' algorihtmName | algorithmDefinition ) ')'
+
+algorithmDefinition ::=
+ ('SHARDING_ALGORITHM' '=' algorithmName | 'TYPE' '(' 'NAME' '=' algorithmType ( ',' 'PROPERTIES' '(' propertyDefinition ')' )?')' )
+
+propertyDefinition ::=
+ ( key '=' value ) ( ',' key '=' value )*
+
+tableName ::=
+ identifier
+
+resourceName ::=
+ identifier
+
+columnName ::=
+ identifier
+
+algorithmName ::=
+ identifier
+```
+
+### 补充说明
+
+- `tableDefinition` 为标准分片规则定义;
+- `autoTableDefinition`为自动分片规则定义。标准分片规则和自动分片规则可参考[数据分片](/cn/user-manual/shardingsphere-jdbc/yaml-config/rules/sharding/)。
+- 当使用标准分片时:
+ - `DATANODES` 只能使用已经添加到当前逻辑库的资源,且只能使用 INLINE 表达式指定需要的资源
+ - `DATABASE_STRATEGY`、`TABLE_STRATEGY` 表示分库和分表策略,均为可选项,未配置时使用默认策略
+ - `strategyDefinition` 中属性 `TYPE` 用于指定[分片算法](/cn/features/sharding/concept/sharding/#自定义分片算法)的类型,目前仅支持 `STANDARD`
+ 、`COMPLEX`。使用 `COMPLEX` 时需要用 `SHARDING_COLUMNS` 指定多个分片键。
+- 当使用自动分片时:
+ - `RESOURCES` 只能使用已经添加到当前逻辑库的资源,可通过枚举或 INLINE 表达式指定需要的资源
+ - 只能使用自动分片算法,可参考[自动分片算法](/cn/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding/#自动分片算法)
+- `algorithmType` 为分片算法类型,分片算法类型请参考[分片算法](/cn/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding/)
+- 自动生成的算法命名规则为 `tableName` _ `strategyType` _ `algorithmType`
+- 自动生成的主键策略命名规则为 `tableName` _ `strategyType`
+- `KEY_GENERATE_STRATEGY`
+ 用于指定主键生成策略,为可选项,关于主键生成策略可参考[分布式主键](/cn/user-manual/shardingsphere-jdbc/builtin-algorithm/keygen/)
+
+### 示例
+
+#### 1.标准分片规则
+
+- ##### 修改分片算法并修改标准分片规则为指定分片算法
+
+```sql
+-- 修改分片算法
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- 修改分片规则为指定分片算法
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}"),
+ DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM=database_inline),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline)
+);
+```
+
+- ##### 修改默认分库策略并修改标准分片规则为指定分片算法
+
+```sql
+-- 修改分片算法
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- 修改默认分库策略
+ALTER DEFAULT SHARDING DATABASE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=database_inline
+);
+
+-- 修改分片规则为指定分片算法
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}"),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline)
+);
+```
+
+- ##### 修改默认分库分表策略并修改标准分片规则为指定分片算法
+
+```sql
+-- 修改分片算法
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- 修改默认分库策略
+ALTER DEFAULT SHARDING DATABASE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=database_inline
+);
+
+-- 修改默认分表策略
+ALTER DEFAULT SHARDING TABLE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline
+);
+
+-- 修改分片规则
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}")
+);
+```
+
+- ##### 修改标准分片规则的同时创建分片算法
+
+```sql
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}"),
+ DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${user_id % 2}")))),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${order_id % 2}"))))
+);
+```
+
+#### 2.自动分片规则
+
+- ##### 修改自动分片规则
+
+```sql
+ALTER SHARDING TABLE RULE t_order (
+ RESOURCES(ds_0, ds_1),
+ SHARDING_COLUMN=order_id, TYPE(NAME=MOD, PROPERTIES("sharding-count"=4))
+);
+```
+
+### 保留字
+
+`ALTER`、`SHARDING`、`TABLE`、`RULE`、`DATANODES`、`DATABASE_STRATEGY`、`TABLE_STRATEGY`、`KEY_GENERATE_STRATEGY`、`RESOURCES`、`SHARDING_COLUMN`、`TYPE`、`SHARDING_COLUMN`、`KEY_GENERATOR`、`SHARDING_ALGORITHM`、`COLUMN`、`NAME`、`PROPERTIES`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+- [ALTER SHARDING ALGORITHM](/cn/reference/distsql/syntax/rdl/rule-definition/alter-sharding-algorithm/)
+- [ALTER DEFAULT_SHARDING STRATEGY](/cn/reference/distsql/syntax/rdl/rule-definition/alter-default-sharding-strategy/)
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.en.md
new file mode 100644
index 00000000000..8a10bcec23c
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/alter-sharding-table-rule.en.md
@@ -0,0 +1,173 @@
++++
+title = "ALTER SHARDING TABLE RULE"
+weight = 3
++++
+
+## Description
+
+The `ALTER SHARDING TABLE RULE` syntax is used to alter sharding table rule for the currently selected database
+
+### Syntax
+
+```sql
+AlterShardingTableRule ::=
+ 'ALTER' 'SHARDING' 'TABLE' 'RULE' ( tableDefinition | autoTableDefinition ) ( ',' ( tableDefinition | autoTableDefinition ) )*
+
+tableDefinition ::=
+ tableName '(' 'DATANODES' '(' dataNode ( ',' dataNode )* ')' ( ',' 'DATABASE_STRATEGY' '(' strategyDefinition ')' )? ( ',' 'TABLE_STRATEGY' '(' strategyDefinition ')' )? ( ',' 'KEY_GENERATE_STRATEGY' '(' keyGenerateStrategyDefinition ')' )? ')'
+
+autoTableDefinition ::=
+ tableName '(' 'RESOURCES' '(' resourceName ( ',' resourceName )* ')' ',' 'SHARDING_COLUMN' '=' columnName ',' algorithmDefinition ( ',' 'KEY_GENERATE_STRATEGY' '(' keyGenerateStrategyDefinition ')' )?')'
+
+strategyDefinition ::=
+ 'TYPE' '=' strategyType ',' ( 'SHARDING_COLUMN' | 'SHARDING_COLUMNS' ) '=' columnName ',' algorithmDefinition
+
+keyGenerateStrategyDefinition ::=
+ 'KEY_GENERATE_STRATEGY' '(' 'COLUMN' '=' columnName ',' ( 'KEY_GENERATOR' '=' algorihtmName | algorithmDefinition ) ')'
+
+algorithmDefinition ::=
+ ('SHARDING_ALGORITHM' '=' algorithmName | 'TYPE' '(' 'NAME' '=' algorithmType ( ',' 'PROPERTIES' '(' propertyDefinition ')' )?')' )
+
+propertyDefinition ::=
+ ( key '=' value ) ( ',' key '=' value )*
+
+tableName ::=
+ identifier
+
+resourceName ::=
+ identifier
+
+columnName ::=
+ identifier
+
+algorithmName ::=
+ identifier
+```
+
+### Supplement
+
+- `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 [Data Sharding](en/user-manual/shardingsphere-jdbc/yaml-config/rules/sharding/).
+- 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` in `strategyDefinition` is used to specify the type
+ of [Sharding Algorithm](/en/features/sharding/concept/sharding/#user-defined-sharding-algorithm), currently only
+ supports `STANDARD`, `COMPLEX`. Using `COMPLEX` requires specifying multiple sharding columns
+ with `SHARDING_COLUMNS`.
+- use auto sharding table rule
+ - `RESOURCES` can only use resources that have been added to the current database, and the required resources can be
+ specified by enumeration or INLINE expression
+ - Only auto sharding algorithm can be used, please refer
+ to [Auto Sharding Algorithm](/en/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding/#auto-sharding-algorithm)
+- `algorithmType` is the sharding algorithm type, please refer
+ to [Sharding Algorithm](en/user-manual/shardingsphere-jdbc/builtin-algorithm/sharding)
+- 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](/en/user-manual/shardingsphere-jdbc/builtin-algorithm/keygen/)
+
+### Example
+
+#### 1.Standard sharding table rule
+
+- ##### Alter standard sharding table rule to the specified sharding algorithms being altered
+
+```SQL
+-- alter sharding algorithms
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- alter a sharding rule to the specified sharding algorithms being altered
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}"),
+ DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM=database_inline),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline)
+);
+```
+
+- ##### Use the altered default sharding database strategy, alter standard sharding table rule to the specified sharding algorithm being altered
+
+```sql
+-- alter sharding algorithms
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- alter a default sharding database strategy
+ALTER DEFAULT SHARDING DATABASE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=database_inline
+);
+
+-- alter a sharding table rule to the specified sharding algorithm being altered
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}"),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline)
+);
+```
+
+- ##### Use both the altered default sharding and the altered default sharding strategy, alter standard sharding table rule
+
+```SQL
+-- alter sharding algorithms
+ALTER SHARDING ALGORITHM database_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${user_id % 4}"))
+), table_inline (
+ TYPE(NAME=inline, PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
+);
+
+-- alter a default sharding database strategy
+ALTER DEFAULT SHARDING DATABASE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=database_inline
+);
+
+-- alter a default sharding table strategy
+ALTER DEFAULT SHARDING TABLE STRATEGY (
+ TYPE = standard, SHARDING_COLUMN=order_id, SHARDING_ALGORITHM=table_inline
+);
+
+-- alter a sharding table rule
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("resource_${0..3}.t_order_item${0..3}")
+);
+```
+
+- ##### Alter standard sharding table rule and create sharding algorithms at the same time
+
+```sql
+ALTER SHARDING TABLE RULE t_order (
+ DATANODES("ds_${0..1}.t_order_${0..1}"),
+ DATABASE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${user_id % 2}")))),
+ TABLE_STRATEGY(TYPE=standard, SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=inline, PROPERTIES("algorithm-expression"="ds_${order_id % 2}"))))
+);
+```
+
+#### 2.Auto sharding table rule
+
+- ##### alter auto sharding table rule
+
+```sql
+ALTER SHARDING TABLE RULE t_order (
+ RESOURCES(ds_0, ds_1),
+ SHARDING_COLUMN=order_id, TYPE(NAME=MOD, PROPERTIES("sharding-count"=4))
+);
+```
+
+### Reserved word
+
+`ALTER`, `SHARDING`, `TABLE`, `RULE`, `DATANODES`, `DATABASE_STRATEGY`, `TABLE_STRATEGY`, `KEY_GENERATE_STRATEGY`, `RESOURCES`, `SHARDING_COLUMN`, `TYPE`, `SHARDING_COLUMN`, `KEY_GENERATOR`, `SHARDING_ALGORITHM`, `COLUMN`, `NAME`, `PROPERTIES`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+- [ALTER SHARDING ALGORITHM](/en/reference/distsql/syntax/rdl/rule-definition/alter-sharding-algorithm/)
+- [ALTER DEFAULT_SHARDING STRATEGY](/en/reference/distsql/syntax/rdl/rule-definition/alter-default-sharding-strategy/)
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.cn.md
index e4938a25240..a67ba5b1782 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.cn.md
@@ -1,6 +1,6 @@
+++
title = "CREATE DEFAULT SHARDING STRATEGY"
-weight = 3
+weight = 5
+++
## 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.en.md
index 47bb2bad23a..2e5a6b901e2 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.en.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-default-sharding-strategy.en.md
@@ -1,6 +1,6 @@
+++
title = "CREATE DEFAULT SHARDING STRATEGY"
-weight = 3
+weight = 5
+++
## Description
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.cn.md
index cbfcce653c6..71c158b5bdc 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.cn.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING ALGORITHM"
-weight = 2
+weight = 4
+++
## 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.en.md
index 48a493346d0..330d0f810d2 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.en.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-algorithm.en.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING ALGORITHM"
-weight = 2
+weight = 4
+++
## Description
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.cn.md
index af22a560e7b..91c4eeefec9 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING BINDING TABLE RULE"
-weight = 4
+weight = 6
+++
## 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.en.md
index b3538cb5084..2571631a2da 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.en.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING BINDING TABLE RULE"
-weight = 4
+weight = 6
+++
## Description
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.cn.md
index df6e20a24f0..1007b31d17d 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING BROADCAST TABLE RULE"
-weight = 5
+weight = 7
+++
## 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.en.md
index 66f1f6d09bc..4b640f94395 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.en.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-broadcast-table-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING BROADCAST TABLE RULE"
-weight = 5
+weight = 7
+++
## Description
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.cn.md
index b8b462e7bab..aba53536bb7 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.cn.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING KEY GENERATOR"
-weight = 6
+weight = 8
+++
## 描述
diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.en.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.en.md
index 6833380f927..44cdd3347fb 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.en.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-key-generator.en.md
@@ -1,6 +1,6 @@
+++
title = "CREATE SHARDING KEY GENERATOR"
-weight = 6
+weight = 8
+++
## Description
diff --git a/docs/document/content/reference/distsql/syntax/reserved-word.cn.md b/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
index c1d9f92aabe..9df06802188 100644
--- a/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
+++ b/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
@@ -12,7 +12,7 @@ weight = 3
#### SHARDING
-`CREATE`、`DEFAULT`、`SHARDING`、`BROADCAST`、`BINDING`、`DATABASE`、`TABLE`、`STRATEGY`、`RULE`、`RULES`、`ALGORITHM`、`DATANODES`
+`CREATE`、`ALTER`、`DEFAULT`、`SHARDING`、`BROADCAST`、`BINDING`、`DATABASE`、`TABLE`、`STRATEGY`、`RULE`、`RULES`、`ALGORITHM`、`DATANODES`
、`DATABASE_STRATEGY`、`TABLE_STRATEGY`、`KEY_GENERATE_STRATEGY`、`RESOURCES`、`SHARDING_COLUMN`、`KEY`、`GENERATOR`、`TYPE`
、`SHARDING_COLUMNS`、`KEY_GENERATOR`、`SHARDING_ALGORITHM`、`COLUMN`、`NAME`、`PROPERTIES`