Skip to content

Commit

Permalink
Update RQL documents (#21655)
Browse files Browse the repository at this point in the history
* Update RQL documents

* Update RQL documents
  • Loading branch information
Qianyi951015 authored Oct 20, 2022
1 parent 8848cfa commit 668c26c
Show file tree
Hide file tree
Showing 6 changed files with 450 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
+++
title = "SHOW SHARDING TABLE RULES USED ALGORITHM"
weight = 11
+++

### 描述

`SHOW SHARDING TABLE RULES USED ALGORITHM` 语法用于查询指定逻辑库中使用指定分片算法的分片规则。

### 语法

```
ShowShardingTableRulesUsedAlgorithm::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'ALGORITHM' algorithmName ('FROM' databaseName)?
algorithmName ::=
identifier
databaseName ::=
identifier
```

### 补充说明

- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`

### 返回值说明

|| 说明 |
| ------| --------------|
| type | 分片规则类型 |
| name | 分片规则名称 |

### 示例

- 查询指定逻辑库中使用指定分片算法的分片规则

```sql
SHOW SHARDING TABLE RULES USED ALGORITHM table_inline FROM test1;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED ALGORITHM table_inline FROM test1;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.00 sec)
```

- 查询当前逻辑库中使用指定分片算法的分片规则

```sql
SHOW SHARDING TABLE RULES USED ALGORITHM table_inline;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED ALGORITHM table_inline;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.01 sec)
```

### 保留字

`SHOW``SHARDING``TABLE``RULES``USED``ALGORITHM``FROM`

### 相关链接

- [保留字](/cn/reference/distsql/syntax/reserved-word/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
+++
title = "SHOW SHARDING TABLE NODES"
weight = 11

+++

### Description

`SHOW SHARDING TABLE RULES USED ALGORITHM` syntax is used to query sharding rules used specified sharding algorithm in specified logical database

### Syntax

```
ShowShardingTableRulesUsedAlgorithm::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'ALGORITHM' algorithmName ('FROM' databaseName)?
algorithmName ::=
identifier
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

| Columns | Descriptions |
| ------------| -------------------|
| type | Sharding rule type |
| name | Sharding rule name |

### Example

- Query sharding table rules for the specified sharding algorithm in spicified logical database

```sql
SHOW SHARDING TABLE RULES USED ALGORITHM table_inline FROM test1;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED ALGORITHM table_inline FROM test1;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.00 sec)
```

- Query sharding table rules for specified sharding algorithm in the current logical database

```sql
SHOW SHARDING TABLE RULES USED ALGORITHM table_inline;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED ALGORITHM table_inline;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.01 sec)
```

### Reserved word

`SHOW``SHARDING``TABLE``RULES``USED``ALGORITHM``FROM`

### Related links

- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
+++
title = "SHOW SHARDING TABLE RULES USED AUDITOR"
weight = 13
+++

### 描述

`SHOW SHARDING TABLE RULES USED AUDITOR` 语法用于查询指定逻辑库中使用指定分片审计器的分片规则。

### 语法

```
ShowShardingTableRulesUsedAuditor::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'AUDITOR' AuditortorName ('FROM' databaseName)?
AuditortorName ::=
identifier
databaseName ::=
identifier
```

### 补充说明

- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`

### 返回值说明

|| 说明 |
| ------| --------------|
| type | 分片规则类型 |
| name | 分片规则名称 |

### 示例

- 查询指定逻辑库中使用指定分片审计器的分片规则

```sql
SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor FROM sharding_db;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor FROM sharding_db;
+-------+---------+
| type | name |
+-------+---------+
| table | t_order |
+-------+---------+
1 row in set (0.00 sec)
```

- 查询当前逻辑库中使用指定分片审计器的分片规则

```sql
SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor;
+-------+---------+
| type | name |
+-------+---------+
| table | t_order |
+-------+---------+
1 row in set (0.00 sec)
```

### 保留字

`SHOW``SHARDING``TABLE``RULES``USED``AUDITOR``FROM`

### 相关链接

- [保留字](/cn/reference/distsql/syntax/reserved-word/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
+++
title = "SHOW SHARDING TABLE RULES USED AUDITOR"
weight = 13

+++

### Description

`SHOW SHARDING TABLE RULES USED ALGORITHM` syntax is used to query sharding rules used specified sharding auditor in specified logical database

### Syntax

```
ShowShardingTableRulesUsedAuditor::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'AUDITOR' AuditortorName ('FROM' databaseName)?
AuditortorName ::=
identifier
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

| Columns | Descriptions |
| ------------| -------------------|
| type | Sharding rule type |
| name | Sharding rule name |

### Example

- Query sharding table rules for the specified sharding auditor in spicified logical database

```sql
SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor FROM sharding_db;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor FROM sharding_db;
+-------+---------+
| type | name |
+-------+---------+
| table | t_order |
+-------+---------+
1 row in set (0.00 sec)
```

- Query sharding table rules for specified sharding auditor in the current logical database

```sql
SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED AUDITOR sharding_key_required_auditor;
+-------+---------+
| type | name |
+-------+---------+
| table | t_order |
+-------+---------+
1 row in set (0.00 sec)
```

### Reserved word

`SHOW``SHARDING``TABLE``RULES``USED``AUDITOR``FROM`

### Related links

- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
+++
title = "SHOW SHARDING TABLE RULES USED KEY GENERATOR"
weight = 12
+++

### 描述

`SHOW SHARDING TABLE RULES USED KEY GENERATOR` 语法用于查询指定逻辑库中使用指定分片主键生成器的分片规则。

### 语法

```
ShowShardingTableRulesUsedKeyGenerator::=
'SHOW' 'SHARDING' 'TABLE' 'RULES' 'USED' 'KEY' 'GENERATOR' keyGeneratorName ('FROM' databaseName)?
keyGeneratorName ::=
identifier
databaseName ::=
identifier
```

### 补充说明

- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`

### 返回值说明

|| 说明 |
| ------| --------------|
| type | 分片规则类型 |
| name | 分片规则名称 |

### 示例

- 查询指定逻辑库中使用指定分片主键生成器的分片规则

```sql
SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator FROM test1;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator FROM test1;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.00 sec)
```

- 查询当前逻辑库中使用指定分片主键生成器的分片规则

```sql
SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator;
```

```sql
mysql> SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake_key_generator;
+-------+--------------+
| type | name |
+-------+--------------+
| table | t_order_item |
+-------+--------------+
1 row in set (0.01 sec)
```

### 保留字

`SHOW``SHARDING``TABLE``USED``KEY``GENERATOR``FROM`

### 相关链接

- [保留字](/cn/reference/distsql/syntax/reserved-word/)

Loading

0 comments on commit 668c26c

Please sign in to comment.