imchao9 commented on a change in pull request #14062:
URL: https://github.com/apache/shardingsphere/pull/14062#discussion_r767632947



##########
File path: docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
##########
@@ -110,7 +126,13 @@ ADD RESOURCE ds_2 (
 
 
详情请参见[RDL#数据分片](/cn/user-manual/shardingsphere-proxy/usage/distsql/syntax/rdl/rdl-sharding-rule/)。
 
-`SHARDING TABLE RULE`支持2种类型:`TableRule`和`AutoTableRule`。对于同一个逻辑表,不能混合使用这2种格式。
+`SHARDING TABLE 
RULE`支持2种类型:`TableRule`和`AutoTableRule`。对于同一个逻辑表,不能混合使用这2种格式,以下是两种分片规则的对比:
+| 名称         | AutoTableRule(自动分片)                                    | 
TableRule(自定义分片)                                      |
+| ------------ | ------------------------------------------------------------ 
| ------------------------------------------------------------ |
+| 定义         | 5.x版本之后,引入的自动分片技术交由 ShardingSphere 
自动管理分片,用户只需要指定分片数量和使用的数据源,无需再关心表的具体分布详情可参见:https://shardingsphere.apache.org/document/current/cn/features/sharding/concept/sharding/#自动化分片算法
 | 需要自定义分片配置,可设置物理数据节点,数据分片、表分片等   |
+| 推荐使用场景 | 
不需要关心实际表在哪个库、哪个库有几张表等问题只需考虑:SHARDING_COLUMN:设置用作分片键的列TYPE:设置分片算法和数量GENERATED_KEY:设置分布式自增ID
 | 
需要设置以下参数:DATANODES:物理数据节点表达式DATABASE_STRATEGY:数据库分片策略TABLE_STRATEGY:表分片策略GENERATED_KEY:设置分布式自增ID
 |
+| 示例         | `ALTER SHARDING TABLE RULE t_order ( RESOURCES(ds_2, ds_3, 
ds_4), SHARDING_COLUMN=order_id, 
TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=10)), 
GENERATED_KEY(COLUMN=another_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
 );` | `ALTER SHARDING TABLE RULE t_order ( 
DATANODES("ds_${2..4}.t_order_${0..1}"), 
DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
 
TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=t_order_inline),
 
GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))) 
);` |

Review comment:
       Yes, it's the same as below, so I will remove it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to