Skip to content
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
14 changes: 11 additions & 3 deletions information-schema/information-schema-analyze-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ DESC analyze_status;
7 rows in set (0.00 sec)
```

The `STATE` column shows the execution status of a specific `ANALYZE` task. Its value can be `pending`, `running`,`finished` or `failed`.

{{< copyable "sql" >}}

```sql
Expand All @@ -49,4 +47,14 @@ SELECT * FROM `ANALYZE_STATUS`;
| test | t1 | p2 | analyze columns | 1 | 2019-06-21 19:51:15 | finished |
+--------------+------------+----------------+-------------------+----------------+---------------------+----------+
6 rows in set
```
```

Fields in the `ANALYZE_STATUS` table are described as follows:

* `TABLE_SCHEMA`: The name of the database to which the table belongs.
* `TABLE_NAME`: The name of the table.
* `PARTITION_NAME`: The name of the partitioned table.
* `JOB_INFO`: The information of the `ANALYZE` task.
* `PROCESSED_ROWS`: The number of rows that have been processed.
* `START_TIME`: The start time of the `ANALYZE` task.
* `STATE`: The execution status of the `ANALYZE` task. Its value can be `pending`, `running`,`finished` or `failed`.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ DESC collation_character_set_applicability;
SELECT * FROM collation_character_set_applicability WHERE character_set_name='utf8mb4';
```

```
```sql
+----------------+--------------------+
| COLLATION_NAME | CHARACTER_SET_NAME |
+----------------+--------------------+
Expand All @@ -39,11 +39,6 @@ SELECT * FROM collation_character_set_applicability WHERE character_set_name='ut
1 row in set (0.00 sec)
```

+----------------+--------------------+
| COLLATION_NAME | CHARACTER_SET_NAME |
| utf8mb4_bin | utf8mb4 |
+----------------+--------------------+

The description of columns in the `COLLATION_CHARACTER_SET_APPLICABILITY` table is as follows:

* `COLLATION_NAME`: The name of the collation.
Expand Down
17 changes: 6 additions & 11 deletions information-schema/information-schema-collations.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DESC collations;
SELECT * FROM collations WHERE character_set_name='utf8mb4';
```

```
```sql
+----------------+--------------------+------+------------+-------------+---------+
| COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN |
+----------------+--------------------+------+------------+-------------+---------+
Expand All @@ -43,16 +43,11 @@ SELECT * FROM collations WHERE character_set_name='utf8mb4';
1 row in set (0.00 sec)
```

The description of columns in the `COLLATION` table is
as follows:
The description of columns in the `COLLATION` table is as follows:

* `COLLATION_NAME`: The name of the collation.
* `CHARACTER_SET_NAME`: The name of the character set
which the collation belongs to.
* `CHARACTER_SET_NAME`: The name of the character set which the collation belongs to.
* `ID`: The ID of the collation.
* `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.
* `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.
3 changes: 2 additions & 1 deletion information-schema/information-schema-processlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ summary: Learn the `PROCESSLIST` information_schema table.

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

* A `MEM` column to show memory occupied by the request being handled (in bytes)
* A `MEM` column to show the memory used by the request that is being processed, in bytes.
* A `TxnStart` column to show the start time of the transaction

{{< copyable "sql" >}}
Expand Down Expand Up @@ -69,6 +69,7 @@ Fields in the `PROCESSLIST` table are described as follows:
* STATE: The current connection state.
* INFO: The requested statement that is being processed.
* MEM: The memory used by the request that is being processed, in bytes.
* TxnStart: The start time of the transaction.

## CLUSTER_PROCESSLIST

Expand Down
7 changes: 3 additions & 4 deletions information-schema/information-schema-session-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC session_variables;
```

```
```sql
+----------------+---------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+------+---------+-------+
Expand All @@ -30,7 +30,7 @@ DESC session_variables;
SELECT * FROM session_variables ORDER BY variable_name LIMIT 10;
```

```
```sql
+-----------------------------------+------------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+-----------------------------------+------------------+
Expand All @@ -51,5 +51,4 @@ SELECT * FROM session_variables ORDER BY variable_name LIMIT 10;
The description of columns in the `SESSION_VARIABLES` table is as follows:

* `VARIABLE_NAME`: The name of the session-level variable in the database.
* `VARIABLE_VALUE`: The value of the session-level
variable in the database.
* `VARIABLE_VALUE`: The value of the session-level variable in the database.
23 changes: 22 additions & 1 deletion information-schema/information-schema-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC statistics;
```

```
```sql
+---------------+---------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+------+---------+-------+
Expand All @@ -40,6 +40,27 @@ DESC statistics;
18 rows in set (0.00 sec)
```

Fields in the `STATISTICS` table are described as follows:

* `TABLE_CATALOG`: The name of the catalog to which the table containing the index belongs. This value is always `def`.
* `TABLE_SCHEMA`: The name of the database to which the table containing the index belongs.
* `TABLE_NAME`: The name of the table containing the index.
* `NON_UNIQUE`: If the index must not contain duplicate values, the value is `0`; if duplicate values are allowed in the index, the value is `1`.
* `INDEX_SCHEMA`: The name of the database to which the index belongs.
* `INDEX_NAME`: The name of the index. If the index is the primary key, then the value is always `PRIMARY`.
* `SEQ_IN_INDEX`: The column number in the index, starting from `1`.
* `COLUMN_NAME`: The column name. See the description of the `Expression` column.
* `COLLATION`: The sorting method of the columns in the index. The value can be `A` (ascending order), `D` (descending order) or `NULL` (unsorted).
* `CARDINALITY`: The estimated number of unique values ​​in the index. To update this value, execute `ANALYZE TABLE`.
* `SUB_PART`: The prefix of the index. If only part of the prefix of the column is indexed, the value is the number of indexed characters; if the entire column is indexed, the value is `NULL`.
* `PACKED`: TiDB does not use this field. This value is always `NULL`.
* `NULLABLE`: If the column might contain a `NULL` value, the value is `YES`; if not, the value is `''`.
* `INDEX_TYPE`: The type of the index.
* `COMMENT`: Other information related to the index.
* `INDEX_COMMENT`: Any comment with comment attribute provided for the index when creating the index.
* `IS_VISIBLE`: Whether the optimizer can use this index.
* `Expression` For the index key of the non-expression part, this value is `NULL`; for the index key of the expression part, this value is the expression itself. Refer to [Expression Index](/sql-statements/sql-statement-create-index.md#expression-index).

The following statements are equivalent:

```sql
Expand Down
13 changes: 9 additions & 4 deletions information-schema/information-schema-table-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC table_constraints;
```

```
```sql
+--------------------+--------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+------+---------+-------+
Expand All @@ -34,7 +34,7 @@ DESC table_constraints;
SELECT * FROM table_constraints WHERE constraint_type='UNIQUE';
```

```
```sql
+--------------------+--------------------+-------------------------+--------------------+-------------------------------------+-----------------+
| CONSTRAINT_CATALOG | CONSTRAINT_SCHEMA | CONSTRAINT_NAME | TABLE_SCHEMA | TABLE_NAME | CONSTRAINT_TYPE |
+--------------------+--------------------+-------------------------+--------------------+-------------------------------------+-----------------+
Expand All @@ -49,5 +49,10 @@ SELECT * FROM table_constraints WHERE constraint_type='UNIQUE';
7 rows in set (0.01 sec)
```

- The `CONSTRAINT_TYPE` value can be `UNIQUE`, `PRIMARY KEY`, or `FOREIGN KEY`.
- The `UNIQUE` and `PRIMARY KEY` information is similar to the result of the `SHOW INDEX` statement.
Fields in the `TABLE_CONSTRAINTS` table are described as follows:

* `CONSTRAINT_CATALOG`: The name of the catalog to which the constraint belongs. This value is always `def`.
* `CONSTRAINT_SCHEMA`: The name of the database to which the constraint belongs.
* `CONSTRAINT_NAME`: The name of the constraint.
* `TABLE_NAME`: The name of the table.
* `CONSTRAINT_TYPE`: The type of the constraint. The value can be `UNIQUE`, `PRIMARY KEY` or `FOREIGN KEY`. The `UNIQUE` and `PRIMARY KEY` information is similar to the execution result of the `SHOW INDEX` statement.
4 changes: 2 additions & 2 deletions information-schema/information-schema-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC tables;
```

```
```sql
+---------------------------+---------------+------+------+----------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+---------------+------+------+----------+-------+
Expand Down Expand Up @@ -51,7 +51,7 @@ DESC tables;
SELECT * FROM tables WHERE table_schema='mysql' AND table_name='user'\G
```

```
```sql
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: mysql
Expand Down
4 changes: 2 additions & 2 deletions information-schema/information-schema-tikv-region-peers.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ WHERE
region.region_id = peer.region_id
AND peer.is_leader = 1
AND peer.store_id = tikv.store_id;
```
```

Fields in the `TIKV_REGION_PEERS` table are described as follows:
Fields in the `TIKV_REGION_PEERS` table are described as follows:

* REGION_ID: The Region ID.
* PEER_ID: The ID of the Region peer.
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefi
| [`INSPECTION_RULES`](/information-schema/information-schema-inspection-rules.md) | A list of internal diagnostic checks performed. |
| [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) | A summarized report of important monitoring metrics. |
| [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) | A summary of metrics extracted from Prometheus. |
| `METRICS_SUMMARY_BY_LABEL` | See `METRICS_SUMAMARY` table. |
| `METRICS_SUMMARY_BY_LABEL` | See `METRICS_SUMMARY` table. |
| [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) | Provides the PromQL definitions for tables in `METRICS_SCHEMA`. |
| [`SEQUENCES`](/information-schema/information-schema-sequences.md) | The TiDB implementation of sequences is based on MariaDB. |
| [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) | Provides information on slow queries on the current TiDB server. |
Expand Down