From 2a28941d9664ca2ac84fa3f03dced81983bb1842 Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 14 May 2024 14:37:17 +0800 Subject: [PATCH 1/2] information_schema: Add links --- .../information-schema-analyze-status.md | 11 ++++++----- .../information-schema-character-sets.md | 7 +++++++ ...on-schema-collation-character-set-applicability.md | 7 +++++++ information-schema/information-schema-collations.md | 7 +++++++ information-schema/information-schema-columns.md | 4 ++++ information-schema/information-schema-engines.md | 8 ++++---- information-schema/information-schema-memory-usage.md | 5 +++++ information-schema/information-schema-partitions.md | 6 +++++- information-schema/information-schema-processlist.md | 8 ++------ .../information-schema-referential-constraints.md | 2 +- information-schema/information-schema-schemata.md | 4 +--- information-schema/information-schema-sequences.md | 8 ++++++++ .../information-schema-session-variables.md | 2 +- information-schema/information-schema-slow-query.md | 2 +- .../information-schema-table-constraints.md | 2 +- .../information-schema-user-privileges.md | 4 ++++ .../information-schema-variables-info.md | 2 +- information-schema/information-schema-views.md | 7 ++++++- 18 files changed, 71 insertions(+), 25 deletions(-) diff --git a/information-schema/information-schema-analyze-status.md b/information-schema/information-schema-analyze-status.md index cee9b2baf225..2634c0fbbaaa 100644 --- a/information-schema/information-schema-analyze-status.md +++ b/information-schema/information-schema-analyze-status.md @@ -11,8 +11,6 @@ summary: 了解 information_schema 表 `ANALYZE_STATUS`。 从 TiDB v6.1.0 起,可以通过系统表 `mysql.analyze_jobs` 查看过去 7 天内的历史任务记录。 -{{< copyable "sql" >}} - ```sql USE information_schema; DESC analyze_status; @@ -40,8 +38,6 @@ DESC analyze_status; 14 rows in set (0.00 sec) ``` -{{< copyable "sql" >}} - ```sql SELECT * FROM information_schema.analyze_status; ``` @@ -76,4 +72,9 @@ SELECT * FROM information_schema.analyze_status; * `PROCESS_ID`:执行任务的 process ID。 * `REMAINING_SECONDS`:执行任务预计还需要多少秒才能完成。 * `PROGRESS`:执行任务的进度。 -* `ESTIMATED_TOTAL_ROWS`:执行任务需要分析的总行数。 \ No newline at end of file +* `ESTIMATED_TOTAL_ROWS`:执行任务需要分析的总行数。 + +## 另请参阅 + +- [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) +- [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) \ No newline at end of file diff --git a/information-schema/information-schema-character-sets.md b/information-schema/information-schema-character-sets.md index 336f15540b6f..2f92cd4ad367 100644 --- a/information-schema/information-schema-character-sets.md +++ b/information-schema/information-schema-character-sets.md @@ -54,3 +54,10 @@ SELECT * FROM `CHARACTER_SETS`; * `DEFAULT_COLLATE_NAME`:字符集的默认排序规则名称 * `DESCRIPTION`:字符集的描述信息 * `MAXLEN`:该字符集存储一个字符所需要的最大字节数 + +## 另请参阅 + +- [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) +- [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) +- [`INFORMATION_SCHEMA.COLLATIONS`](/information-schema/information-schema-collations.md) +- [`INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) \ No newline at end of file diff --git a/information-schema/information-schema-collation-character-set-applicability.md b/information-schema/information-schema-collation-character-set-applicability.md index 0bc65e477b4f..a0035f058247 100644 --- a/information-schema/information-schema-collation-character-set-applicability.md +++ b/information-schema/information-schema-collation-character-set-applicability.md @@ -47,3 +47,10 @@ SELECT * FROM COLLATION_CHARACTER_SET_APPLICABILITY WHERE character_set_name='ut * `COLLATION_NAME`:排序规则名称 * `CHARACTER_SET_NAME`:排序规则所属的字符集名称 + +## 另请参阅 + +- [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) +- [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) +- [`INFORMATION_SCHEMA.CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) +- [`INFORMATION_SCHEMA.COLLATIONS`](/information-schema/information-schema-collations.md) \ No newline at end of file diff --git a/information-schema/information-schema-collations.md b/information-schema/information-schema-collations.md index 54c724178e5f..ffc027b78d28 100644 --- a/information-schema/information-schema-collations.md +++ b/information-schema/information-schema-collations.md @@ -53,3 +53,10 @@ SELECT * FROM collations WHERE character_set_name='utf8mb4'; * `IS_DEFAULT`:该排序规则是否是所属字符集的默认排序规则 * `IS_COMPILED`:字符集是否编译到服务器中 * `SORTLEN`:排序规则在对字符进行排序时,所分配内存的最小长度 + +## 另请参阅 + +- [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) +- [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) +- [`INFORMATION_SCHEMA.CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) +- [`INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) \ No newline at end of file diff --git a/information-schema/information-schema-columns.md b/information-schema/information-schema-columns.md index f5b9dafafccb..05b2c86117ed 100644 --- a/information-schema/information-schema-columns.md +++ b/information-schema/information-schema-columns.md @@ -122,3 +122,7 @@ SHOW COLUMNS FROM t1 FROM test; +-------+---------+------+------+---------+-------+ 1 row in set (0.00 sec) ``` + +## 另请参阅 + +- [`SHOW COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) \ No newline at end of file diff --git a/information-schema/information-schema-engines.md b/information-schema/information-schema-engines.md index e411a32766ac..640e66baef61 100644 --- a/information-schema/information-schema-engines.md +++ b/information-schema/information-schema-engines.md @@ -7,8 +7,6 @@ summary: 了解 information_schema 表 `ENGINES`。 `ENGINES` 表提供了关于存储引擎的信息。从和 MySQL 兼容性上考虑,TiDB 会一直将 InnoDB 描述为唯一支持的引擎。此外,`ENGINES` 表中其它列值也都是定值。 -{{< copyable "sql" >}} - ```sql USE information_schema; DESC engines; @@ -28,8 +26,6 @@ DESC engines; 6 rows in set (0.00 sec) ``` -{{< copyable "sql" >}} - ```sql SELECT * FROM engines; ``` @@ -51,3 +47,7 @@ SELECT * FROM engines; * `TRANSACTIONS`:存储引擎是否支持事务。 * `XA`:存储引擎是否支持 XA 事务。 * `SAVEPOINTS`:存储引擎是否支持 `savepoints`。 + +## 另请参阅 + +- [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) \ No newline at end of file diff --git a/information-schema/information-schema-memory-usage.md b/information-schema/information-schema-memory-usage.md index 88d66e37eb3f..8348c03b61e6 100644 --- a/information-schema/information-schema-memory-usage.md +++ b/information-schema/information-schema-memory-usage.md @@ -59,3 +59,8 @@ SELECT * FROM information_schema.memory_usage; * GC_TOTAL:从 TiDB 启动到当前累计由内存使用触发 Golang GC 的次数。 * DISK_USAGE:当前数据落盘的硬盘使用量,单位为 byte。 * QUERY_FORCE_DISK:从 TiDB 启动到当前累计的落盘次数。 + +## 另请参阅 + +- [TiDB 内存控制](/configure-memory-usage.md) +- [TiKV 内存参数性能调优](/tune-tikv-memory-performance.md) \ No newline at end of file diff --git a/information-schema/information-schema-partitions.md b/information-schema/information-schema-partitions.md index 6878aea234a8..007113f7b1b1 100644 --- a/information-schema/information-schema-partitions.md +++ b/information-schema/information-schema-partitions.md @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `PARTITIONS`。 # PARTITIONS -`PARTITIONS` 表提供有关分区表的信息。 +`PARTITIONS` 表提供有关[分区表](/partitioned-table.md)的信息。 ```sql USE INFORMATION_SCHEMA; @@ -115,3 +115,7 @@ SUBPARTITION_ORDINAL_POSITION: NULL TIDB_PLACEMENT_POLICY_NAME: NULL 2 rows in set (0.00 sec) ``` + +## 另请参阅 + +- [用 EXPLAIN 查看分区查询的执行计划](/explain-partitions.md) \ No newline at end of file diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index 68fa2f3d36df..ab8493cdf741 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `PROCESSLIST`。 # PROCESSLIST -`PROCESSLIST` 和 `SHOW PROCESSLIST` 的功能一样,都是查看当前正在处理的请求。 +`PROCESSLIST` 和 [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) 的功能一样,都是查看当前正在处理的请求。 `PROCESSLIST` 表比 `SHOW PROCESSLIST` 的结果多出下面几列: @@ -15,8 +15,6 @@ summary: 了解 information_schema 表 `PROCESSLIST`。 * `TxnStart`列:显示事务的开始时间。 * `RESOURCE_GROUP`列:显示对应的资源组名称。 -{{< copyable "sql" >}} - ```sql USE information_schema; DESC processlist; @@ -43,8 +41,6 @@ DESC processlist; 13 rows in set (0.00 sec) ``` -{{< copyable "sql" >}} - ```sql SELECT * FROM processlist\G ``` @@ -90,7 +86,7 @@ SELECT * FROM processlist\G {{< copyable "sql" >}} ```sql -SELECT * FROM cluster_processlist; +SELECT * FROM information_schema.cluster_processlist; ``` ```sql diff --git a/information-schema/information-schema-referential-constraints.md b/information-schema/information-schema-referential-constraints.md index 8e962fe64513..74ee8558e355 100644 --- a/information-schema/information-schema-referential-constraints.md +++ b/information-schema/information-schema-referential-constraints.md @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `REFERENTIAL_CONSTRAINTS`。 # REFERENTIAL_CONSTRAINTS -`REFERENTIAL_CONSTRAINTS` 表提供 TiDB 表之间 `FOREIGN KEY` 关系的信息。 +`REFERENTIAL_CONSTRAINTS` 表提供 TiDB 表之间 [`FOREIGN KEY`](/foreign-key.md) 关系的信息。 ```sql USE INFORMATION_SCHEMA; diff --git a/information-schema/information-schema-schemata.md b/information-schema/information-schema-schemata.md index 4d16554ca7c6..e0424de83342 100644 --- a/information-schema/information-schema-schemata.md +++ b/information-schema/information-schema-schemata.md @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `SCHEMATA`。 # SCHEMATA -`SCHEMATA` 表提供了关于数据库的信息。表中的数据与 `SHOW DATABASES` 语句的执行结果等价。 +`SCHEMATA` 表提供了关于数据库的信息。表中的数据与 [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) 语句的执行结果等价。 {{< copyable "sql" >}} @@ -27,8 +27,6 @@ desc SCHEMATA; 5 rows in set (0.00 sec) ``` -{{< copyable "sql" >}} - ```sql SELECT * FROM SCHEMATA; ``` diff --git a/information-schema/information-schema-sequences.md b/information-schema/information-schema-sequences.md index 814324b4b543..5578536c3515 100644 --- a/information-schema/information-schema-sequences.md +++ b/information-schema/information-schema-sequences.md @@ -74,3 +74,11 @@ SEQUENCE_SCHEMA: test COMMENT: 1 row in set (0.00 sec) ``` + +## 另请参阅 + +- [`CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) +- [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) +- [`ALTER SEQUENCE`](/sql-statements/sql-statement-alter-sequence.md) +- [`DROP SEQUENCE`](/sql-statements/sql-statement-drop-sequence.md) +- [序列函数](/functions-and-operators/sequence-functions.md) \ No newline at end of file diff --git a/information-schema/information-schema-session-variables.md b/information-schema/information-schema-session-variables.md index 3cf4e621a048..5fe809bc277a 100644 --- a/information-schema/information-schema-session-variables.md +++ b/information-schema/information-schema-session-variables.md @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `SESSION_VARIABLES`。 # SESSION_VARIABLES -`SESSION_VARIABLES` 表提供了关于 session 变量的信息。表中的数据跟 `SHOW SESSION VARIABLES` 语句执行结果类似。 +`SESSION_VARIABLES` 表提供了关于 session 变量的信息。表中的数据跟 [`SHOW SESSION VARIABLES`](/sql-statements/sql-statement-show-variables.md) 语句执行结果类似。 ```sql USE INFORMATION_SCHEMA; diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index d007a684aa4c..009bc347284a 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `SLOW_QUERY`。 # SLOW_QUERY -`SLOW_QUERY` 表中提供了当前节点的慢查询相关的信息,其内容通过解析当前节点的 TiDB 慢查询日志而来,列名和慢日志中的字段名是一一对应。关于如何使用该表调查和改善慢查询,请参考[慢查询日志文档](/identify-slow-queries.md)。 +`SLOW_QUERY` 表中提供了当前节点的慢查询相关的信息,其内容通过解析当前节点的 TiDB [慢查询日志](/tidb-configuration-file.md#slow-query-file)而来,列名和慢日志中的字段名是一一对应。关于如何使用该表调查和改善慢查询,请参考[慢查询日志文档](/identify-slow-queries.md)。 ```sql USE INFORMATION_SCHEMA; diff --git a/information-schema/information-schema-table-constraints.md b/information-schema/information-schema-table-constraints.md index fcbde4c3c5e1..a3ef2f8e90c9 100644 --- a/information-schema/information-schema-table-constraints.md +++ b/information-schema/information-schema-table-constraints.md @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `TABLE_CONSTRAINTS`。 # TABLE_CONSTRAINTS -`TABLE_CONSTRAINTS` 表记录了表的约束信息。 +`TABLE_CONSTRAINTS` 表记录了表的[约束](/constraints.md)信息。 {{< copyable "sql" >}} diff --git a/information-schema/information-schema-user-privileges.md b/information-schema/information-schema-user-privileges.md index 9827c18293b0..5ec5fe6ddab6 100644 --- a/information-schema/information-schema-user-privileges.md +++ b/information-schema/information-schema-user-privileges.md @@ -79,3 +79,7 @@ SELECT * FROM USER_PRIVILEGES; * `TABLE_CATALOG`:表所属的目录的名称。该值始终为 `def`。 * `PRIVILEGE_TYPE`:被授权的权限类型,每行只列一个权限。 * `IS_GRANTABLE`:如果用户有 `GRANT OPTION` 的权限,则为 `YES`,否则为 `NO`。 + +## 另请参阅 + +- [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) diff --git a/information-schema/information-schema-variables-info.md b/information-schema/information-schema-variables-info.md index 480e174334be..056eb8f0081e 100644 --- a/information-schema/information-schema-variables-info.md +++ b/information-schema/information-schema-variables-info.md @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `VARIABLES_INFO`。 # VARIABLES_INFO -`VARIABLES_INFO` 可用于查看当前 TiDB 集群或实例的系统变量默认值、当前值以及作用域等信息。 +`VARIABLES_INFO` 可用于查看当前 TiDB 集群或实例的[系统变量](/system-variables.md)默认值、当前值以及作用域等信息。 ```sql USE information_schema; diff --git a/information-schema/information-schema-views.md b/information-schema/information-schema-views.md index 06e9737db3d6..021d7cb033d0 100644 --- a/information-schema/information-schema-views.md +++ b/information-schema/information-schema-views.md @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `VIEWS`。 # VIEWS -`VIEWS` 表提供了关于 SQL 视图的信息。 +`VIEWS` 表提供了关于 [SQL 视图](/views.md)的信息。 ```sql USE INFORMATION_SCHEMA; @@ -68,3 +68,8 @@ COLLATION_CONNECTION: utf8mb4_0900_ai_ci * `SECURITY_TYPE`:`SQL SECURITY` 的值,取值为 `DEFINER` 或 `INVOKER`。 * `CHARACTER_SET_CLIENT`:在视图创建时 session 变量 `character_set_client` 的值。 * `COLLATION_CONNECTION`:在视图创建时 session 变量 `collation_connection` 的值。 + +## 另请参阅 + +- [`CREATE VIEW`](/sql-statements/sql-statement-create-view.md) +- [`DROP VIEW`](/sql-statements/sql-statement-drop-view.md) \ No newline at end of file From d5c8ca322b5c6141038bb8321034015186142bbe Mon Sep 17 00:00:00 2001 From: Aolin Date: Tue, 14 May 2024 15:23:55 +0800 Subject: [PATCH 2/2] fix --- information-schema/information-schema-schemata.md | 2 -- information-schema/information-schema.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/information-schema/information-schema-schemata.md b/information-schema/information-schema-schemata.md index e0424de83342..78d439fd0013 100644 --- a/information-schema/information-schema-schemata.md +++ b/information-schema/information-schema-schemata.md @@ -7,8 +7,6 @@ summary: 了解 information_schema 表 `SCHEMATA`。 `SCHEMATA` 表提供了关于数据库的信息。表中的数据与 [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) 语句的执行结果等价。 -{{< copyable "sql" >}} - ```sql USE information_schema; desc SCHEMATA; diff --git a/information-schema/information-schema.md b/information-schema/information-schema.md index 421ffece5be6..8c10593a7f96 100644 --- a/information-schema/information-schema.md +++ b/information-schema/information-schema.md @@ -6,7 +6,7 @@ title: Information Schema Information Schema 提供了一种查看系统元数据的 ANSI 标准方法。除了包含与 MySQL 兼容的表外,TiDB 还提供了许多自定义的 `INFORMATION_SCHEMA` 表。 -许多 `INFORMATION_SCHEMA` 表都有相应的 `SHOW` 命令。查询 `INFORMATION_SCHEMA` 的好处是可以在表之间进行 `join` 操作。 +许多 `INFORMATION_SCHEMA` 表都可以通过相应的 `SHOW` 语句查看。查询 `INFORMATION_SCHEMA` 的好处是可以在表之间进行 `join` 操作。 ## 与 MySQL 兼容的表