Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

information_schema: Add links (#17327) #17330

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions information-schema/information-schema-analyze-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -40,8 +38,6 @@ DESC analyze_status;
14 rows in set (0.00 sec)
```

{{< copyable "sql" >}}

```sql
SELECT * FROM information_schema.analyze_status;
```
Expand Down Expand Up @@ -76,4 +72,9 @@ SELECT * FROM information_schema.analyze_status;
* `PROCESS_ID`:执行任务的 process ID。
* `REMAINING_SECONDS`:执行任务预计还需要多少秒才能完成。
* `PROGRESS`:执行任务的进度。
* `ESTIMATED_TOTAL_ROWS`:执行任务需要分析的总行数。
* `ESTIMATED_TOTAL_ROWS`:执行任务需要分析的总行数。

## 另请参阅

- [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md)
- [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md)
7 changes: 7 additions & 0 deletions information-schema/information-schema-character-sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 7 additions & 0 deletions information-schema/information-schema-collations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 4 additions & 0 deletions information-schema/information-schema-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions information-schema/information-schema-engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ summary: 了解 information_schema 表 `ENGINES`。

`ENGINES` 表提供了关于存储引擎的信息。从和 MySQL 兼容性上考虑,TiDB 会一直将 InnoDB 描述为唯一支持的引擎。此外,`ENGINES` 表中其它列值也都是定值。

{{< copyable "sql" >}}

```sql
USE information_schema;
DESC engines;
Expand All @@ -28,8 +26,6 @@ DESC engines;
6 rows in set (0.00 sec)
```

{{< copyable "sql" >}}

```sql
SELECT * FROM engines;
```
Expand All @@ -51,3 +47,7 @@ SELECT * FROM engines;
* `TRANSACTIONS`:存储引擎是否支持事务。
* `XA`:存储引擎是否支持 XA 事务。
* `SAVEPOINTS`:存储引擎是否支持 `savepoints`。

## 另请参阅

- [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md)
5 changes: 5 additions & 0 deletions information-schema/information-schema-memory-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 5 additions & 1 deletion information-schema/information-schema-partitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `PARTITIONS`。

# PARTITIONS

`PARTITIONS` 表提供有关分区表的信息
`PARTITIONS` 表提供有关[分区表](/partitioned-table.md)的信息

```sql
USE INFORMATION_SCHEMA;
Expand Down Expand Up @@ -115,3 +115,7 @@ SUBPARTITION_ORDINAL_POSITION: NULL
TIDB_PLACEMENT_POLICY_NAME: NULL
2 rows in set (0.00 sec)
```

## 另请参阅

- [用 EXPLAIN 查看分区查询的执行计划](/explain-partitions.md)
8 changes: 2 additions & 6 deletions information-schema/information-schema-processlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 的结果多出下面几列:

Expand All @@ -15,8 +15,6 @@ summary: 了解 information_schema 表 `PROCESSLIST`。
* `TxnStart`列:显示事务的开始时间。
* `RESOURCE_GROUP`列:显示对应的资源组名称。

{{< copyable "sql" >}}

```sql
USE information_schema;
DESC processlist;
Expand All @@ -43,8 +41,6 @@ DESC processlist;
13 rows in set (0.00 sec)
```

{{< copyable "sql" >}}

```sql
SELECT * FROM processlist\G
```
Expand Down Expand Up @@ -90,7 +86,7 @@ SELECT * FROM processlist\G
{{< copyable "sql" >}}

```sql
SELECT * FROM cluster_processlist;
SELECT * FROM information_schema.cluster_processlist;
```

```sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions information-schema/information-schema-schemata.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ summary: 了解 information_schema 表 `SCHEMATA`。

# SCHEMATA

`SCHEMATA` 表提供了关于数据库的信息。表中的数据与 `SHOW DATABASES` 语句的执行结果等价。

{{< copyable "sql" >}}
`SCHEMATA` 表提供了关于数据库的信息。表中的数据与 [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) 语句的执行结果等价。

```sql
USE information_schema;
Expand All @@ -27,8 +25,6 @@ desc SCHEMATA;
5 rows in set (0.00 sec)
```

{{< copyable "sql" >}}

```sql
SELECT * FROM SCHEMATA;
```
Expand Down
8 changes: 8 additions & 0 deletions information-schema/information-schema-sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion information-schema/information-schema-session-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-table-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `TABLE_CONSTRAINTS`。

# TABLE_CONSTRAINTS

`TABLE_CONSTRAINTS` 表记录了表的约束信息
`TABLE_CONSTRAINTS` 表记录了表的[约束](/constraints.md)信息

{{< copyable "sql" >}}

Expand Down
4 changes: 4 additions & 0 deletions information-schema/information-schema-user-privileges.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion information-schema/information-schema-variables-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解 information_schema 表 `VARIABLES_INFO`。

# VARIABLES_INFO

`VARIABLES_INFO` 可用于查看当前 TiDB 集群或实例的系统变量默认值、当前值以及作用域等信息。
`VARIABLES_INFO` 可用于查看当前 TiDB 集群或实例的[系统变量](/system-variables.md)默认值、当前值以及作用域等信息。

```sql
USE information_schema;
Expand Down
7 changes: 6 additions & 1 deletion information-schema/information-schema-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解 INFORMATION_SCHEMA 表 `VIEWS`。

# VIEWS

`VIEWS` 表提供了关于 SQL 视图的信息
`VIEWS` 表提供了关于 [SQL 视图](/views.md)的信息

```sql
USE INFORMATION_SCHEMA;
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion information-schema/information-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 兼容的表

Expand Down
Loading