You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/12/29 00:28:22 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #23134: Add IF NOT EXISTS to all CREATE statements in DistSQL documents

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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org