Skip to content

Commit

Permalink
information_schema: Add links (#17251) (#17483)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored May 15, 2024
1 parent 1e99648 commit 8c9fa15
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 29 deletions.
7 changes: 5 additions & 2 deletions information-schema/information-schema-analyze-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Starting from TiDB v6.1.0, the `ANALYZE_STATUS` table supports showing cluster-l

Starting from TiDB v6.1.0, you can view the history tasks within the last 7 days through the system table `mysql.analyze_jobs`.

{{< copyable "sql" >}}

```sql
USE information_schema;
DESC analyze_status;
Expand Down Expand Up @@ -77,3 +75,8 @@ Fields in the `ANALYZE_STATUS` table are described as follows:
* `REMAINING_SECONDS`: The estimated time (in seconds) remaining for the task to complete.
* `PROGRESS`: The progress of the task.
* `ESTIMATED_TOTAL_ROWS`: The total rows that need to be analyzed by the task.

## See also

- [`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 @@ The description of columns in the `CHARACTER_SETS` table is as follows:
* `DEFAULT_COLLATE_NAME` The default collation name of the character set.
* `DESCRIPTION` The description of the character set.
* `MAXLEN` The maximum length required to store a character in this character set.

## See also

- [`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 @@ The description of columns in the `COLLATION_CHARACTER_SET_APPLICABILITY` table

* `COLLATION_NAME`: The name of the collation.
* `CHARACTER_SET_NAME`: The name of the character set which the collation belongs to.

## See also

- [`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 @@ The description of columns in the `COLLATIONS` table is as follows:
* `IS_DEFAULT`: Whether this collation is the default collation of the character set it belongs to.
* `IS_COMPILED`: Whether the character set is compiled into the server.
* `SORTLEN`: The minimum length of memory allocated when the collation sorts characters.

## See also

- [`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)
6 changes: 5 additions & 1 deletion information-schema/information-schema-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,8 @@ The output is as follows:
| a | int(11) | YES | | NULL | |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)
```
```

## See also

- [`SHOW COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md)
10 changes: 5 additions & 5 deletions information-schema/information-schema-engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ summary: Learn the `ENGINES` information_schema table.

The `ENGINES` table provides information about storage engines. For compatibility, TiDB will always describe InnoDB as the only supported engine. In addition, other column values in the `ENGINES` table are also fixed values.

{{< 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 @@ -50,4 +46,8 @@ The description of columns in the `ENGINES` table is as follows:
* `COMMENT`: The brief comment on the storage engine.
* `TRANSACTIONS`: Whether the storage engine supports transactions.
* `XA`: Whether the storage engine supports XA transactions.
* `SAVEPOINTS`: Whether the storage engine supports `savepoints`.
* `SAVEPOINTS`: Whether the storage engine supports `savepoints`.

## See also

- [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md)
16 changes: 16 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,19 @@ The columns in the `MEMORY_USAGE` table are described as follows:
* GC_TOTAL: The number of times Golang GC is triggered by memory usage, from the time TiDB is started to the current time.
* DISK_USAGE: The disk usage for the current data spill operation, in bytes.
* QUERY_FORCE_DISK: The number of times data is spilled to disk, from the time TiDB is started to the current time.

## See also

<CustomContent platform="tidb">

- [TiDB memory control](/configure-memory-usage.md)
- [Tune TiKV memory parameter performance](/tune-tikv-memory-performance.md)

</CustomContent>

<CustomContent platform="tidb-cloud">

- [TiDB memory control](https://docs.pingcap.com/tidb/stable/configure-memory-usage)
- [Tune TiKV memory parameter performance](https://docs.pingcap.com/tidb/stable/tune-tikv-memory-performance)

</CustomContent>
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: Learn the `PARTITIONS` INFORMATION_SCHEMA table.

# PARTITIONS

The `PARTITIONS` table provides information about partitioned tables.
The `PARTITIONS` table provides information about [partitioned tables](/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)
```

## See also

- [Explain statements using partitions](/explain-partitions.md)
8 changes: 1 addition & 7 deletions information-schema/information-schema-processlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn the `PROCESSLIST` information_schema table.

# PROCESSLIST

`PROCESSLIST`, just like `SHOW PROCESSLIST`, is used to view the requests that are being handled.
`PROCESSLIST`, just like [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md), is used to view the requests that are being handled.

The `PROCESSLIST` table has additional columns not present in `SHOW PROCESSLIST`:

Expand All @@ -15,8 +15,6 @@ The `PROCESSLIST` table has additional columns not present in `SHOW PROCESSLIST`
* A `TxnStart` column to show the start time of the transaction.
* A `RESOURCE_GROUP` column to show the resource group name.

{{< 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 @@ -87,8 +83,6 @@ Fields in the `PROCESSLIST` table are described as follows:

`CLUSTER_PROCESSLIST` is the cluster system table corresponding to `PROCESSLIST`. It is used to query the `PROCESSLIST` information of all TiDB nodes in the cluster. The table schema of `CLUSTER_PROCESSLIST` has one more column than `PROCESSLIST`, the `INSTANCE` column, which stores the address of the TiDB node this row of data is from.

{{< copyable "sql" >}}

```sql
SELECT * FROM information_schema.cluster_processlist;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn the `REFERENTIAL_CONSTRAINTS` INFORMATION_SCHEMA table.

# REFERENTIAL_CONSTRAINTS

The `REFERENTIAL_CONSTRAINTS` table provides information about `FOREIGN KEY` relationships between tables.
The `REFERENTIAL_CONSTRAINTS` table provides information about [`FOREIGN KEY`](/foreign-key.md) relationships between tables.

```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: Learn the `SCHEMATA` information_schema table.

# SCHEMATA

The `SCHEMATA` table provides information about databases. The table data is equivalent to the result of the `SHOW DATABASES` statement.

{{< copyable "sql" >}}
The `SCHEMATA` table provides information about databases. The table data is equivalent to the result of the [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) statement.

```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 @@ -75,3 +75,11 @@ SEQUENCE_SCHEMA: test
COMMENT:
1 row in set (0.00 sec)
```

## See also

- [`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)
- [Sequence functions](/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: Learn the `SESSION_VARIABLES` INFORMATION_SCHEMA table.

# SESSION_VARIABLES

The `SESSION_VARIABLES` table provides information about session variables. The table data is similar to the result of the `SHOW SESSION VARIABLES` statement.
The `SESSION_VARIABLES` table provides information about session variables. The table data is similar to the result of the [`SHOW SESSION VARIABLES`](/sql-statements/sql-statement-show-variables.md) statement.

```sql
USE INFORMATION_SCHEMA;
Expand Down
12 changes: 11 additions & 1 deletion information-schema/information-schema-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ summary: Learn the `SLOW_QUERY` INFORMATION_SCHEMA table.

# SLOW_QUERY

The `SLOW_QUERY` table provides the slow query information of the current node, which is the parsing result of the TiDB slow log file. The column names in the table are corresponding to the field names in the slow log.
<CustomContent platform="tidb">

The `SLOW_QUERY` table provides the slow query information of the current node, which is the parsing result of the TiDB [slow log file](/tidb-configuration-file.md#slow-query-file). The column names in the table are corresponding to the field names in the slow log.

</CustomContent>

<CustomContent platform="tidb-cloud">

The `SLOW_QUERY` table provides the slow query information of the current node, which is the parsing result of the TiDB [slow log file](https://docs.pingcap.com/tidb/stable/tidb-configuration-file#slow-query-file). The column names in the table are corresponding to the field names in the slow log.

</CustomContent>

> **Note:**
>
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: Learn the `TABLE_CONSTRAINTS` information_schema table.

# TABLE_CONSTRAINTS

The `TABLE_CONSTRAINTS` table describes which tables have constraints.
The `TABLE_CONSTRAINTS` table describes which tables have [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 @@ -126,3 +126,7 @@ Fields in the `USER_PRIVILEGES` table are described as follows:
* `TABLE_CATALOG`: The name of the catalog to which the table belongs. This value is always `def`.
* `PRIVILEGE_TYPE`: The privilege type to be granted. Only one privilege type is shown in each row.
* `IS_GRANTABLE`: If you have the `GRANT OPTION` privilege, the value is `YES`; otherwise, the value is `NO`.

## See also

- [`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: Learn the `VARIABLES_INFO` information_schema table.

# VARIABLES_INFO

The `VARIABLES_INFO` table provides information about the default value, current value, and scope of system variables in the current TiDB instance or TiDB cluster.
The `VARIABLES_INFO` table provides information about the default value, current value, and scope of [system variables](/system-variables.md) in the current TiDB instance or TiDB cluster.

```sql
USE information_schema;
Expand Down
9 changes: 7 additions & 2 deletions information-schema/information-schema-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Learn the `VIEWS` INFORMATION_SCHEMA table.

# VIEWS

The `VIEWS` table provides information about SQL views.
The `VIEWS` table provides information about [SQL views](/views.md).

```sql
USE INFORMATION_SCHEMA;
Expand Down Expand Up @@ -67,4 +67,9 @@ Fields in the `VIEWS` table are described as follows:
* `DEFINER`: The name of the user who creates the view, which is in the format of `'user_name'@'host_name'`.
* `SECURITY_TYPE`: The value of `SQL SECURITY`. The value options are `DEFINER` and `INVOKER`.
* `CHARACTER_SET_CLIENT`: The value of the `character_set_client` session variable when the view is created.
* `COLLATION_CONNECTION`: The value of the `collation_connection` session variable when the view is created.
* `COLLATION_CONNECTION`: The value of the `collation_connection` session variable when the view is created.

## See also

- [`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 @@ -7,7 +7,7 @@ summary: TiDB implements the ANSI-standard information_schema for viewing system

Information Schema provides an ANSI-standard way of viewing system metadata. TiDB also provides a number of custom `INFORMATION_SCHEMA` tables, in addition to the tables included for MySQL compatibility.

Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables.
Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` statement. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables.

## Tables for MySQL compatibility

Expand Down

0 comments on commit 8c9fa15

Please sign in to comment.