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/10/17 08:33:33 UTC
[shardingsphere] branch master updated: Update RQL show default sharding strategy documents (#21607)
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 85781faa0f1 Update RQL show default sharding strategy documents (#21607)
85781faa0f1 is described below
commit 85781faa0f13994707bc4b8293d96bc344f4664a
Author: Qianyi951015 <57...@users.noreply.github.com>
AuthorDate: Mon Oct 17 16:33:23 2022 +0800
Update RQL show default sharding strategy documents (#21607)
* Update RQL show default sharding strategy documents
* Update RQL show default sharding strategy documents
---
.../sharding/show-default-sharding-strategy.cn.md | 78 ++++++++++++++++++++++
.../sharding/show-default-sharding-strategy.en.md | 77 +++++++++++++++++++++
2 files changed, 155 insertions(+)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.cn.md
new file mode 100644
index 00000000000..82c2d975e32
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.cn.md
@@ -0,0 +1,78 @@
++++
+title = "SHOW DEFAULT SHARDING STRATEGY"
+weight = 5
++++
+
+### 描述
+
+`SHOW DEFAULT SHARDING STRATEGY` 语法用于查询指定逻辑库的默认分片策略。
+
+### 语法
+
+```
+ShowDefaultShardingStrategy::=
+ 'SHOW' 'DEFAULT' 'SHARDING' 'STRATEGY' ('FROM' databaseName)?
+
+databaseName ::=
+ identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列 | 说明 |
+| ------------------------| --------------|
+| name | 分片策略范围 |
+| type | 分片策略类型 |
+| sharding_column | 分片键 |
+| sharding_algorithm_name | 分片算法名称 |
+| sharding_algorithm_type | 分片算法类型 |
+| sharding_algorithm_props| 分片算法参数 |
+
+### 示例
+
+- 查询指定逻辑库的默认分片策略
+
+```sql
+SHOW DEFAULT SHARDING STRATEGY FROM test1;
+```
+
+```sql
+mysql> SHOW DEFAULT SHARDING STRATEGY FROM test1;
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+2 rows in set (0.00 sec)
+```
+
+- 查询当前逻辑库的默认分片策略
+
+```sql
+SHOW DEFAULT SHARDING STRATEGY;
+```
+
+```sql
+mysql> SHOW DEFAULT SHARDING STRATEGY;
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+2 rows in set (0.00 sec)
+```
+
+### 保留字
+
+`SHOW`、`DEFAULT`、`SHARDING`、`STRATEGY`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.en.md
new file mode 100644
index 00000000000..bc5617f38db
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-default-sharding-strategy.en.md
@@ -0,0 +1,77 @@
++++
+title = "SHOW DEFAULT SHARDING STRATEGY"
+weight = 5
++++
+
+### Description
+
+The `SHOW DEFAULT SHARDING STRATEGY` syntax is used to query default sharding strategy in specified database.
+
+### Syntax
+
+```
+ShowDefaultShardingStrategy::=
+ 'SHOW' 'DEFAULT' 'SHARDING' 'STRATEGY' ('FROM' databaseName)?
+
+databaseName ::=
+ identifier
+```
+
+### Supplement
+
+- When `databaseName` is not specified, the default is the currently used `DATABASE`. If `DATABASE` is not used, `No database selected` will be prompted.
+
+### Return value description
+
+| Column | Description |
+| ------------------------ | ----------------------------- |
+| name | Sharding strategy scope |
+| type | Sharding strategy type |
+| sharding_column | Sharding column |
+| sharding_algorithm_name | Sharding algorithm name |
+| sharding_algorithm_type | Sharding algorithm type |
+| sharding_algorithm_props | Sharding algorithm properties |
+
+### Example
+
+- Query default sharding strategy in specified database.
+
+```sql
+SHOW DEFAULT SHARDING STRATEGY FROM test1;
+```
+
+```sql
+mysql> SHOW DEFAULT SHARDING STRATEGY FROM test1;
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+2 rows in set (0.00 sec)
+```
+
+- Query default sharding strategy in current database.
+
+```sql
+SHOW DEFAULT SHARDING STRATEGY;
+```
+
+```sql
+mysql> SHOW DEFAULT SHARDING STRATEGY;
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| name | type | sharding_column | sharding_algorithm_name | sharding_algorithm_type | sharding_algorithm_props |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+| TABLE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
+| DATABASE | STANDARD | order_id | table_inline | inline | {algorithm-expression=t_order_item_${order_id % 2}} |
++----------+----------+-----------------+-------------------------+-------------------------+-----------------------------------------------------+
+2 rows in set (0.00 sec)
+```
+
+### Reserved word
+
+`SHOW`、`DEFAULT`、`SHARDING`、`STRATEGY`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)