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/11/07 04:15:19 UTC

[shardingsphere] branch master updated: Update DistSQL documents (#21983)

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 7f316f32841 Update DistSQL documents (#21983)
7f316f32841 is described below

commit 7f316f3284132ccf0f7a98bedb4dcbd25fde88fa
Author: Zichao <57...@users.noreply.github.com>
AuthorDate: Mon Nov 7 17:15:13 2022 +1300

    Update DistSQL documents (#21983)
---
 .../db-discovery/count-db-discovery-rule.cn.md     | 74 ++++++++++++++++++++
 .../db-discovery/count-db-discovery-rule.en.md     | 73 ++++++++++++++++++++
 .../rule-query/encrypt/count-encrypt-rule.cn.md    | 74 ++++++++++++++++++++
 .../rule-query/encrypt/count-encrypt-rule.en.md    | 73 ++++++++++++++++++++
 .../count-readwrite-splitting-rule.cn.md           | 74 ++++++++++++++++++++
 .../count-readwrite-splitting-rule.en.md           | 73 ++++++++++++++++++++
 .../rql/rule-query/shadow/count-shadow-rule.cn.md  | 74 ++++++++++++++++++++
 .../rql/rule-query/shadow/count-shadow-rule.en.md  | 73 ++++++++++++++++++++
 .../rule-query/sharding/count-sharding-rule.cn.md  | 78 ++++++++++++++++++++++
 .../rule-query/sharding/count-sharding-rule.en.md  | 77 +++++++++++++++++++++
 10 files changed, 743 insertions(+)

diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.cn.md
new file mode 100644
index 00000000000..bcbe1d4f72b
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.cn.md
@@ -0,0 +1,74 @@
++++
+title = "COUNT DB_DISCOVERY RULE"
+weight = 5
++++
+
+### 描述
+
+`COUNT DB_DISCOVERY RULE` 语法用于查询指定逻辑库中的数据库发现规则数量。
+
+### 语法
+
+```sql
+CountDBDiscoveryRule::=
+  'COUNT' 'DB_DISCOVERY' 'RULE' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明            |
+| --------- | ---------------|
+| rule_name | 规则类型        |
+| database  | 规则所属逻辑库   |
+| count     | 规则数量        |
+
+
+### 示例
+
+- 查询指定逻辑库中的数据库发现规则数量
+
+```sql
+COUNT DB_DISCOVERY RULE FROM test1;
+```
+
+```sql
+mysql> COUNT DB_DISCOVERY RULE FROM test1;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| db_discovery | test1    | 1     |
++--------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+- 查询当前逻辑库中的数据库发现规则数量
+
+```sql
+COUNT DB_DISCOVERY RULE;
+```
+
+```sql
+mysql> COUNT DB_DISCOVERY RULE;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| db_discovery | test1    | 1     |
++--------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`COUNT`、`DB_DISCOVERY`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.en.md
new file mode 100644
index 00000000000..ca4e39a80fe
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/db-discovery/count-db-discovery-rule.en.md
@@ -0,0 +1,73 @@
++++
+title = "COUNT DB_DISCOVERY RULE"
+weight = 5
++++
+
+### Description
+
+The `COUNT DB_DISCOVERY RULE` syntax is used to query the number of database discovery rules for specified database.
+
+### Syntax
+
+```sql
+CountDBDiscoveryRule::=
+  'COUNT' 'DB_DISCOVERY' 'RULE' ('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                             |
+| ----------| ----------------------------------------|
+| rule_name | rule type                               |
+| database  | the database to which the rule belongs  |
+| count     | the number of the rule                  |
+
+
+### Example
+
+- Query the number of database discovery rules for specified database.
+
+```sql
+COUNT DB_DISCOVERY RULE FROM test1;
+```
+
+```sql
+mysql> COUNT DB_DISCOVERY RULE FROM test1;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| db_discovery | test1    | 1     |
++--------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+- Query the number of database discovery rules for current database.
+
+```sql
+COUNT DB_DISCOVERY RULE;
+```
+
+```sql
+mysql> COUNT DB_DISCOVERY RULE;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| db_discovery | test1    | 1     |
++--------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`COUNT`, `DB_DISCOVERY`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.cn.md
new file mode 100644
index 00000000000..69b196d72a0
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.cn.md
@@ -0,0 +1,74 @@
++++
+title = "COUNT ENCRYPT RULE"
+weight = 4
++++
+
+### 描述
+
+`COUNT ENCRYPT RULE` 语法用于查询指定逻辑库中的加密规则数量。
+
+### 语法
+
+```sql
+CountEncryptRule::=
+  'COUNT' 'ENCRYPT' 'RULE' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明            |
+| --------- | ---------------|
+| rule_name | 规则类型        |
+| database  | 规则所属逻辑库   |
+| count     | 规则数量        |
+
+
+### 示例
+
+- 查询指定逻辑库中的加密规则数量
+
+```sql
+COUNT ENCRYPT RULE FROM test1;
+```
+
+```sql
+mysql> COUNT ENCRYPT RULE FROM test1;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| encrypt   | test1    | 2     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+- 查询当前逻辑库中的加密规则数量
+
+```sql
+COUNT ENCRYPT RULE;
+```
+
+```sql
+mysql> COUNT ENCRYPT RULE;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| encrypt   | test1    | 2     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+### 保留字
+
+`COUNT`、`ENCRYPT`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.en.md
new file mode 100644
index 00000000000..8ce5cfd0933
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/encrypt/count-encrypt-rule.en.md
@@ -0,0 +1,73 @@
++++
+title = "COUNT ENCRYPT RULE"
+weight = 4
++++
+
+### Description
+
+The `COUNT ENCRYPT RULE` syntax is used to query the number of encrypt rules for specified database.
+
+### Syntax
+
+```sql
+CountEncryptRule::=
+  'COUNT' 'ENCRYPT' 'RULE' ('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                             |
+| ----------| ----------------------------------------|
+| rule_name | rule type                               |
+| database  | the database to which the rule belongs  |
+| count     | the number of the rule                  |
+
+
+### Example
+
+- Query the number of encrypt rules for specified database.
+
+```sql
+COUNT ENCRYPT RULE FROM test1;
+```
+
+```sql
+mysql> COUNT ENCRYPT RULE FROM test1;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| encrypt   | test1    | 2     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+- Query the number of encrypt rules for current database.
+
+```sql
+COUNT ENCRYPT RULE;
+```
+
+```sql
+mysql> COUNT ENCRYPT RULE;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| encrypt   | test1    | 2     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+### Reserved word
+
+`COUNT`, `ENCRYPT`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.cn.md
new file mode 100644
index 00000000000..b3c1690460c
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.cn.md
@@ -0,0 +1,74 @@
++++
+title = "COUNT READWRITE_SPLITTING RULE"
+weight = 3
++++
+
+### 描述
+
+`COUNT READWRITE_SPLITTING RULE` 语法用于查询指定逻辑库中的读写分离规则数量。
+
+### 语法
+
+```sql
+CountReadwriteSplittingRule::=
+  'COUNT' 'READWRITE_SPLITTING' 'RULE' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明            |
+| --------- | ---------------|
+| rule_name | 规则类型        |
+| database  | 规则所属逻辑库   |
+| count     | 规则数量        |
+
+
+### 示例
+
+- 查询指定逻辑库中的读写分离规则数量
+
+```sql
+COUNT READWRITE_SPLITTING RULE FROM test1;
+```
+
+```sql
+mysql> COUNT READWRITE_SPLITTING RULE FROM test1;
++---------------------+----------+-------+
+| rule_name           | database | count |
++---------------------+----------+-------+
+| readwrite_splitting | test1    | 1     |
++---------------------+----------+-------+
+1 row in set (0.02 sec)
+```
+
+- 查询当前逻辑库中的读写分离规则数量
+
+```sql
+COUNT READWRITE_SPLITTING RULE;
+```
+
+```sql
+mysql> COUNT READWRITE_SPLITTING RULE;
++---------------------+----------+-------+
+| rule_name           | database | count |
++---------------------+----------+-------+
+| readwrite_splitting | test1    | 1     |
++---------------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`COUNT`、`READWRITE_SPLITTING`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.en.md
new file mode 100644
index 00000000000..488448102c7
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/readwrite-splitting/count-readwrite-splitting-rule.en.md
@@ -0,0 +1,73 @@
++++
+title = "COUNT READWRITE_SPLITTING RULE"
+weight = 3
++++
+
+### Description
+
+The `COUNT READWRITE_SPLITTING RULE` syntax is used to query the number of readwrite splitting rules for specified database.
+
+### Syntax
+
+```sql
+CountReadwriteSplittingRule::=
+  'COUNT' 'READWRITE_SPLITTING' 'RULE' ('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                             |
+| ----------| ----------------------------------------|
+| rule_name | rule type                               |
+| database  | the database to which the rule belongs  |
+| count     | the number of the rule                  |
+
+
+### Example
+
+- Query the number of readwrite splitting rules for specified database.
+
+```sql
+COUNT READWRITE_SPLITTING RULE FROM test1;
+```
+
+```sql
+mysql> COUNT READWRITE_SPLITTING RULE FROM test1;
++---------------------+----------+-------+
+| rule_name           | database | count |
++---------------------+----------+-------+
+| readwrite_splitting | test1    | 1     |
++---------------------+----------+-------+
+1 row in set (0.02 sec)
+```
+
+- Query the number of readwrite splitting rules for current database.
+
+```sql
+COUNT READWRITE_SPLITTING RULE;
+```
+
+```sql
+mysql> COUNT READWRITE_SPLITTING RULE;
++---------------------+----------+-------+
+| rule_name           | database | count |
++---------------------+----------+-------+
+| readwrite_splitting | test1    | 1     |
++---------------------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`COUNT`, `READWRITE_SPLITTING`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.cn.md
new file mode 100644
index 00000000000..5e6d5354a0e
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.cn.md
@@ -0,0 +1,74 @@
++++
+title = "COUNT SHADOW RULE"
+weight = 5
++++
+
+### 描述
+
+`COUNT SHADOW RULE` 语法用于查询指定逻辑库中的影子库压测规则数量。
+
+### 语法
+
+```sql
+CountShadowRule::=
+  'COUNT' 'SHADOW' 'RULE' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明            |
+| --------- | ---------------|
+| rule_name | 规则类型        |
+| database  | 规则所属逻辑库   |
+| count     | 规则数量        |
+
+
+### 示例
+
+- 查询指定逻辑库中的影子库压测规则数量
+
+```sql
+COUNT SHADOW RULE FROM test1;
+```
+
+```sql
+mysql> COUNT SHADOW RULE FROM test1;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| shadow    | test1    | 1     |
++-----------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+- 查询当前逻辑库中的影子库压测规则数量
+
+```sql
+COUNT SHADOW RULE;
+```
+
+```sql
+mysql> COUNT SHADOW RULE;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| shadow    | test1    | 1     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+### 保留字
+
+`COUNT`、`SHADOW`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.en.md
new file mode 100644
index 00000000000..d89f6df6420
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/shadow/count-shadow-rule.en.md
@@ -0,0 +1,73 @@
++++
+title = "COUNT SHADOW RULE"
+weight = 5
++++
+
+### Description
+
+The `COUNT SHADOW RULE` syntax is used to query the number of shadow rules for specified database.
+
+### Syntax
+
+```sql
+CountShadowRule::=
+  'COUNT' 'SHADOW' 'RULE' ('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                             |
+| ----------| ----------------------------------------|
+| rule_name | rule type                               |
+| database  | the database to which the rule belongs  |
+| count     | the number of the rule                  |
+
+
+### Example
+
+- Query the number of shadow rules for specified database.
+
+```sql
+COUNT SHADOW RULE FROM test1;
+```
+
+```sql
+mysql> COUNT SHADOW RULE FROM test1;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| shadow    | test1    | 1     |
++-----------+----------+-------+
+1 row in set (0.00 sec)
+```
+
+- Query the number of shadow rules for current database.
+
+```sql
+COUNT SHADOW RULE;
+```
+
+```sql
+mysql> COUNT SHADOW RULE;
++-----------+----------+-------+
+| rule_name | database | count |
++-----------+----------+-------+
+| shadow    | test1    | 1     |
++-----------+----------+-------+
+1 row in set (0.01 sec)
+```
+
+### Reserved word
+
+`COUNT`, `SHADOW`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.cn.md
new file mode 100644
index 00000000000..4c3f1d7c18c
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.cn.md
@@ -0,0 +1,78 @@
++++
+title = "COUNT SHARDING RULE"
+weight = 16
++++
+
+### 描述
+
+`COUNT SHARDING RULE` 语法用于查询指定逻辑库中的分片规则数量。
+
+### 语法
+
+```sql
+CountShardingRule::=
+  'COUNT' 'SHARDING' 'RULE' ('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明            |
+| --------- | ---------------|
+| rule_name | 规则类型        |
+| database  | 规则所属逻辑库   |
+| count     | 规则数量        |
+
+
+### 示例
+
+- 查询指定逻辑库中的分片规则数量
+
+```sql
+COUNT SHARDING RULE FROM test1;
+```
+
+```sql
+mysql> COUNT SHARDING RULE FROM test1;
++--------------------------+----------+-------+
+| rule_name                | database | count |
++--------------------------+----------+-------+
+| sharding_table           | test1    | 2     |
+| sharding_table_reference | test1    | 2     |
+| broadcast_table          | test1    | 0     |
++--------------------------+----------+-------+
+3 rows in set (0.00 sec)
+```
+
+- 查询当前逻辑库中的分片规则数量
+
+```sql
+COUNT SHARDING RULE;
+```
+
+```sql
+mysql> COUNT SHARDING RULE;
++--------------------------+----------+-------+
+| rule_name                | database | count |
++--------------------------+----------+-------+
+| sharding_table           | test1    | 2     |
+| sharding_table_reference | test1    | 2     |
+| broadcast_table          | test1    | 0     |
++--------------------------+----------+-------+
+3 rows in set (0.00 sec)
+```
+
+### 保留字
+
+`COUNT`、`SHARDING`、`RULE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.en.md
new file mode 100644
index 00000000000..735687cba14
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/count-sharding-rule.en.md
@@ -0,0 +1,77 @@
++++
+title = "COUNT SHARDING RULE"
+weight = 16
++++
+
+### Description
+
+The `COUNT SHARDING RULE` syntax is used to query the number of sharding rules for specified database.
+
+### Syntax
+
+```sql
+CountShardingRule::=
+  'COUNT' 'SHARDING' 'RULE' ('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                             |
+| ----------| ----------------------------------------|
+| rule_name | rule type                               |
+| database  | the database to which the rule belongs  |
+| count     | the number of the rule                  |
+
+
+### Example
+
+- Query the number of sharding rules for specified database.
+
+```sql
+COUNT SHARDING RULE FROM test1;
+```
+
+```sql
+mysql> COUNT SHARDING RULE FROM test1;
++--------------------------+----------+-------+
+| rule_name                | database | count |
++--------------------------+----------+-------+
+| sharding_table           | test1    | 2     |
+| sharding_table_reference | test1    | 2     |
+| broadcast_table          | test1    | 0     |
++--------------------------+----------+-------+
+3 rows in set (0.00 sec)
+```
+
+- Query the number of sharding rules for current database.
+
+```sql
+COUNT SHARDING RULE;
+```
+
+```sql
+mysql> COUNT SHARDING RULE;
++--------------------------+----------+-------+
+| rule_name                | database | count |
++--------------------------+----------+-------+
+| sharding_table           | test1    | 2     |
+| sharding_table_reference | test1    | 2     |
+| broadcast_table          | test1    | 0     |
++--------------------------+----------+-------+
+3 rows in set (0.00 sec)
+```
+
+### Reserved word
+
+`COUNT`, `SHARDING`, `RULE`, `FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)