RaigorJiang commented on code in PR #23134:
URL: https://github.com/apache/shardingsphere/pull/23134#discussion_r1058665871


##########
docs/document/content/reference/distsql/syntax/rdl/rule-definition/readwrite-splitting/create-readwrite-splitting-rule.cn.md:
##########
@@ -79,6 +83,28 @@ CREATE READWRITE_SPLITTING RULE ms_group_1 (
 );
 ```
 
+#### 使用 `ifNotExists` 子句创建读写分离规则
+
+- 静态读写分离规则
+
+```sql
+CREATE READWRITE_SPLITTING RULE IF NOT EXISTS ms_group_0 (
+    WRITE_STORAGE_UNIT=write_ds,
+    READ_STORAGE_UNITS(read_ds_0,read_ds_1),
+    TYPE(NAME="random")
+);
+```
+
+- 动态读写分离规则
+
+```sql
+CREATE READWRITE_SPLITTING RULE IF NOT EXISTS ms_group_1 (
+    AUTO_AWARE_RESOURCE=group_0,
+    WRITE_DATA_SOURCE_QUERY_ENABLED=false,
+    TYPE(NAME="random",PROPERTIES("read_weight"="2:1"))

Review Comment:
   Random algorithm does need properties, please 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