You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/10/11 05:00:17 UTC

[shardingsphere] branch master updated: Add `SHOW UNUSED SHARDING ALGORITHMS` docs. (#21410)

This is an automated email from the ASF dual-hosted git repository.

zhangliang 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 406ac4a0b43 Add `SHOW UNUSED SHARDING ALGORITHMS` docs. (#21410)
406ac4a0b43 is described below

commit 406ac4a0b43ef1595f8ae67a02135de07ba3f1f1
Author: Jieker <ji...@163.com>
AuthorDate: Tue Oct 11 13:00:09 2022 +0800

    Add `SHOW UNUSED SHARDING ALGORITHMS` docs. (#21410)
---
 .../reference/distsql/syntax/reserved-word.cn.md   |  2 +-
 .../reference/distsql/syntax/reserved-word.en.md   |  2 +-
 .../sharding/show-sharding-algorithms.cn.md        |  2 +-
 .../sharding/show-unused-sharding-algorithms.cn.md | 56 ++++++++++++++++++++++
 .../sharding/show-unused-sharding-algorithms.en.md | 56 ++++++++++++++++++++++
 5 files changed, 115 insertions(+), 3 deletions(-)

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 e92b0c6ce29..b3b8cffeb8c 100644
--- a/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
+++ b/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
@@ -56,7 +56,7 @@ weight = 3
 
 #### 分片
 
-`SHARDING`、`ALGORITHMS`
+`UNUSED`、`SHARDING`、`ALGORITHMS`
 
 ## 补充说明
 
diff --git a/docs/document/content/reference/distsql/syntax/reserved-word.en.md b/docs/document/content/reference/distsql/syntax/reserved-word.en.md
index b5f2f213c03..fcec9bc3816 100644
--- a/docs/document/content/reference/distsql/syntax/reserved-word.en.md
+++ b/docs/document/content/reference/distsql/syntax/reserved-word.en.md
@@ -58,7 +58,7 @@ weight = 3
 
 #### SHARDING
 
-`SHARDING`, `ALGORITHMS`
+`UNUSED`, `SHARDING`, `ALGORITHMS`
 
 ## Supplement
 
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.cn.md
index 858153bbd69..39a75120e51 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.cn.md
@@ -50,7 +50,7 @@ mysql> SHOW SHARDING ALGORITHMS;
 
 ### 保留字
 
-`CREATE`、`SHARDING`、`ALGORITHMS`、`FROM`
+`SHOW`、`SHARDING`、`ALGORITHMS`、`FROM`
 
 ### 相关链接
 
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.cn.md
new file mode 100644
index 00000000000..789277ae282
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.cn.md
@@ -0,0 +1,56 @@
++++
+title = "SHOW UNUSED SHARDING ALGORITHMS"
+weight = 4
++++
+
+### 描述
+
+`SHOW UNUSED SHARDING ALGORITHMS` 语法用于查询指定逻辑库未使用的分片算法。
+
+### 语法
+
+```
+ShowShardingAlgorithms::=
+  'SHOW' 'UNUSED' 'SHARDING' 'ALGORITHMS' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列     | 说明          |
+| ------| --------------|
+| name  | 分片算法名称    |
+| type  | 分片算法类型    |
+| props | 分片算法参数    |
+
+### 示例
+
+- 查询指定逻辑库未使用的分片算法
+
+```sql
+SHOW UNUSED SHARDING ALGORITHMS;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING ALGORITHMS;
++---------------+--------+-----------------------------------------------------+
+| name          | type   | props                                               |
++---------------+--------+-----------------------------------------------------+
+| t1_inline     | INLINE | algorithm-expression=t_order_${order_id % 2}        |
++---------------+--------+-----------------------------------------------------+
+1 row in set (0.01 sec)
+```
+
+### 保留字
+
+`SHOW`、`UNUSED`、`SHARDING`、`ALGORITHMS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.en.md
new file mode 100644
index 00000000000..58e5df892b0
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-algorithms.en.md
@@ -0,0 +1,56 @@
++++
+title = "SHOW UNUSED SHARDING ALGORITHMS"
+weight = 4
++++
+
+### Description
+
+The `SHOW UNUSED SHARDING ALGORITHMS` syntax is used to query the unused sharding algorithms in the specified database.
+
+### Syntax
+
+```
+ShowShardingAlgorithms::=
+  'SHOW' 'UNUSED' 'SHARDING' 'ALGORITHMS' ('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 algorithm name       |
+| type   | Sharding algorithm type       |
+| props  | Sharding algorithm properties |
+
+### Example
+
+- Query the unused sharding table algorithms of the specified logical database
+
+```sql
+SHOW UNUSED SHARDING ALGORITHMS;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING ALGORITHMS;
++---------------+--------+-----------------------------------------------------+
+| name          | type   | props                                               |
++---------------+--------+-----------------------------------------------------+
+| t1_inline     | INLINE | algorithm-expression=t_order_${order_id % 2}        |
++---------------+--------+-----------------------------------------------------+
+1 row in set (0.01 sec)
+```
+
+### Reserved word
+
+`SHOW`, `UNUSED`, `SHARDING`, `ALGORITHMS`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)