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/09/23 09:49:46 UTC
[shardingsphere] branch master updated: Add `SHOW SHARDING ALGORITHMS` docs. (#21148)
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 98d2b5107a5 Add `SHOW SHARDING ALGORITHMS` docs. (#21148)
98d2b5107a5 is described below
commit 98d2b5107a56870ffa5ce4e4eadbf8f9e5efe106
Author: Jieker <ji...@163.com>
AuthorDate: Fri Sep 23 17:49:36 2022 +0800
Add `SHOW SHARDING ALGORITHMS` docs. (#21148)
---
.../sharding/show-sharding-algorithms.cn.md | 57 ++++++++++++++++++++++
.../sharding/show-sharding-algorithms.en.md | 57 ++++++++++++++++++++++
.../sharding/show-sharding-table-rule.cn.md | 17 +++++--
.../sharding/show-sharding-table-rule.en.md | 20 +++++++-
4 files changed, 146 insertions(+), 5 deletions(-)
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
new file mode 100644
index 00000000000..858153bbd69
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.cn.md
@@ -0,0 +1,57 @@
++++
+title = "SHOW SHARDING ALGORITHMS"
+weight = 3
++++
+
+### 描述
+
+`SHOW SHARDING ALGORITHMS` 语法用于查询指定逻辑库的分片算法。
+
+### 语法
+
+```
+ShowShardingAlgorithms::=
+ 'SHOW' 'SHARDING' 'ALGORITHMS' ('FROM' databaseName)?
+
+databaseName ::=
+ identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列 | 说明 |
+| ------| --------------|
+| name | 分片算法名称 |
+| type | 分片算法类型 |
+| props | 分片算法参数 |
+
+### 示例
+
+- 查询指定逻辑库的分片算法
+
+```sql
+SHOW SHARDING ALGORITHMS;
+```
+
+```sql
+mysql> SHOW SHARDING ALGORITHMS;
++-------------------------+--------+-----------------------------------------------------+
+| name | type | props |
++-------------------------+--------+-----------------------------------------------------+
+| t_order_inline | INLINE | algorithm-expression=t_order_${order_id % 2} |
+| t_order_item_inline | INLINE | algorithm-expression=t_order_item_${order_id % 2} |
++-------------------------+--------+-----------------------------------------------------+
+2 row in set (0.01 sec)
+```
+
+### 保留字
+
+`CREATE`、`SHARDING`、`ALGORITHMS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.en.md
new file mode 100644
index 00000000000..b93e5faade8
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-algorithms.en.md
@@ -0,0 +1,57 @@
++++
+title = "SHOW SHARDING ALGORITHMS"
+weight = 3
++++
+
+### Description
+
+The `SHOW SHARDING ALGORITHMS` syntax is used to query the sharding algorithms in the specified database.
+
+### Syntax
+
+```
+ShowShardingAlgorithms::=
+ 'SHOW' '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 sharding table algorithms of the specified logical database
+
+```sql
+SHOW SHARDING ALGORITHMS;
+```
+
+```sql
+mysql> SHOW SHARDING ALGORITHMS;
++-------------------------+--------+-----------------------------------------------------+
+| name | type | props |
++-------------------------+--------+-----------------------------------------------------+
+| t_order_inline | INLINE | algorithm-expression=t_order_${order_id % 2} |
+| t_order_item_inline | INLINE | algorithm-expression=t_order_item_${order_id % 2} |
++-------------------------+--------+-----------------------------------------------------+
+2 row in set (0.01 sec)
+```
+
+### Reserved word
+
+`SHOW`, `SHARDING`, `ALGORITHMS`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.cn.md
index 35d1454b624..6f523fdd9a6 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.cn.md
@@ -1,14 +1,14 @@
+++
title = "SHOW SHARDING TABLE RULE"
-weight = 3
+weight = 2
+++
-
### 描述
`SHOW SHARDING TABLE RULE` 语法用于查询指定逻辑库中的分片规则。
### 语法
+
```
ShowShardingTableRule ::=
'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' databaseName)?
@@ -21,9 +21,10 @@ databaseName ::=
```
### 补充说明
+
- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
- ### 返回值说明
+### 返回值说明
| 列 | 说明 |
| --------------------------------- | ---------------------------------- |
@@ -71,9 +72,11 @@ SHOW SHARDING TABLE RULES;
2 rows in set (0.12 sec)
```
- 查询指定逻辑表的分片规则
+
```sql
SHOW SHARDING TABLE RULE t_order;
```
+
```sql
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
| table | actual_data_nodes | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props | key_generate_column | key_generator_type | key_generator_props |
@@ -82,3 +85,11 @@ SHOW SHARDING TABLE RULE t_order;
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
1 rows in set (0.12 sec)
```
+
+### 保留字
+
+`CREATE`、`SHARDING`、`TABLE`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.en.md
index bd6283bca8e..b82ece4a864 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.en.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-rule.en.md
@@ -1,14 +1,14 @@
+++
title = "SHOW SHARDING TABLE RULE"
-weight = 3
+weight = 2
+++
-
### Description
The `SHOW SHARDING TABLE RULE` syntax is used to query the sharding table rule in the specified database.
### Syntax
+
```
ShowShardingTableRule ::=
'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' databaseName)?
@@ -21,6 +21,7 @@ databaseName ::=
```
### 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
@@ -43,10 +44,13 @@ databaseName ::=
| key_generator_props | Sharding key generator properties |
### Example
+
- Query the sharding table rules of the specified logical database
+
```sql
SHOW SHARDING TABLE RULES FROM sharding_db;
```
+
```sql
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
| table | actual_data_nodes | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props | key_generate_column | key_generator_type | key_generator_props |
@@ -58,9 +62,11 @@ SHOW SHARDING TABLE RULES FROM sharding_db;
```
- Query the sharding table rules of the current logic database
+
```sql
SHOW SHARDING TABLE RULES;
```
+
```sql
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
| table | actual_data_nodes | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props | key_generate_column | key_generator_type | key_generator_props |
@@ -71,9 +77,11 @@ SHOW SHARDING TABLE RULES;
2 rows in set (0.12 sec)
```
- Query the specified sharding table rule
+
```sql
SHOW SHARDING TABLE RULE t_order;
```
+
```sql
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
| table | actual_data_nodes | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props | key_generate_column | key_generator_type | key_generator_props |
@@ -82,3 +90,11 @@ SHOW SHARDING TABLE RULE t_order;
+--------------+-------------------+---------------------+------------------------+--------------------------+----------------------------------+-----------------------------------+---------------------+-----------------------+-------------------------------+--------------------------------+---------------------+--------------------+---------------------+
1 rows in set (0.12 sec)
```
+
+### Reserved word
+
+`SHOW`, `SHARDING`, `TABLE`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)