diff --git a/information-schema/information-schema-analyze-status.md b/information-schema/information-schema-analyze-status.md index 280329928f209..8bec26d34239a 100644 --- a/information-schema/information-schema-analyze-status.md +++ b/information-schema/information-schema-analyze-status.md @@ -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 @@ -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 -``` \ No newline at end of file +``` + +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`. diff --git a/information-schema/information-schema-collation-character-set-applicability.md b/information-schema/information-schema-collation-character-set-applicability.md index 1bc8238b9f1e0..fc4f5606d63d4 100644 --- a/information-schema/information-schema-collation-character-set-applicability.md +++ b/information-schema/information-schema-collation-character-set-applicability.md @@ -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 | +----------------+--------------------+ @@ -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. diff --git a/information-schema/information-schema-collations.md b/information-schema/information-schema-collations.md index 1b3dec5ecc476..75a8ec4299092 100644 --- a/information-schema/information-schema-collations.md +++ b/information-schema/information-schema-collations.md @@ -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 | +----------------+--------------------+------+------------+-------------+---------+ @@ -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. diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index bf2fd7f4713bd..ca9ec1c555756 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -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" >}} @@ -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 diff --git a/information-schema/information-schema-session-variables.md b/information-schema/information-schema-session-variables.md index 04460c8838e7c..2461f43baad31 100644 --- a/information-schema/information-schema-session-variables.md +++ b/information-schema/information-schema-session-variables.md @@ -14,7 +14,7 @@ USE information_schema; DESC session_variables; ``` -``` +```sql +----------------+---------------+------+------+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------------+------+------+---------+-------+ @@ -30,7 +30,7 @@ DESC session_variables; SELECT * FROM session_variables ORDER BY variable_name LIMIT 10; ``` -``` +```sql +-----------------------------------+------------------+ | VARIABLE_NAME | VARIABLE_VALUE | +-----------------------------------+------------------+ @@ -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. diff --git a/information-schema/information-schema-statistics.md b/information-schema/information-schema-statistics.md index 03a5d5a365ab0..b113b21e40094 100644 --- a/information-schema/information-schema-statistics.md +++ b/information-schema/information-schema-statistics.md @@ -14,7 +14,7 @@ USE information_schema; DESC statistics; ``` -``` +```sql +---------------+---------------+------+------+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------+------+------+---------+-------+ @@ -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 diff --git a/information-schema/information-schema-table-constraints.md b/information-schema/information-schema-table-constraints.md index c7b38cad0173c..2b20328a69d50 100644 --- a/information-schema/information-schema-table-constraints.md +++ b/information-schema/information-schema-table-constraints.md @@ -14,7 +14,7 @@ USE information_schema; DESC table_constraints; ``` -``` +```sql +--------------------+--------------+------+------+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------+--------------+------+------+---------+-------+ @@ -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 | +--------------------+--------------------+-------------------------+--------------------+-------------------------------------+-----------------+ @@ -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. \ No newline at end of file +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. diff --git a/information-schema/information-schema-tables.md b/information-schema/information-schema-tables.md index 616be7fde1115..4c54c32d4e49d 100644 --- a/information-schema/information-schema-tables.md +++ b/information-schema/information-schema-tables.md @@ -14,7 +14,7 @@ USE information_schema; DESC tables; ``` -``` +```sql +---------------------------+---------------+------+------+----------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------------+---------------+------+------+----------+-------+ @@ -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 diff --git a/information-schema/information-schema-tikv-region-peers.md b/information-schema/information-schema-tikv-region-peers.md index fd487b1e42b88..9be6b377fe906 100644 --- a/information-schema/information-schema-tikv-region-peers.md +++ b/information-schema/information-schema-tikv-region-peers.md @@ -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. diff --git a/information-schema/information-schema.md b/information-schema/information-schema.md index 677fe061aa2c1..5fbf191e77884 100644 --- a/information-schema/information-schema.md +++ b/information-schema/information-schema.md @@ -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. |