diff --git a/mysql-schema.md b/mysql-schema.md index 13b439f24d707..0f55e80c280b7 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -68,12 +68,17 @@ Currently, the `help_topic` is NULL. * `tidb_ttl_task`: the current ongoing TTL subtasks * `tidb_ttl_job_history`: the execution history of TTL tasks in the last 90 days -## Runaway queries related system tables +## System tables related to runaway queries * `tidb_runaway_queries`: the history records of all identified runaway queries in the past 7 days * `tidb_runaway_watch`: the watch list of runaway queries * `tidb_runaway_watch_done`: a watch list of deleted or expired runaway queries +## System tables related to metadata locks + +* `tidb_mdl_view`:a view of metadata locks. You can use it to view information about the currently blocked DDL statements +* `tidb_mdl_info`:used internally by TiDB to synchronize metadata locks across nodes + ## Miscellaneous system tables diff --git a/sql-statements/sql-statement-admin.md b/sql-statements/sql-statement-admin.md index 7e1a179a79061..155f4caf5637d 100644 --- a/sql-statements/sql-statement-admin.md +++ b/sql-statements/sql-statement-admin.md @@ -12,6 +12,7 @@ This statement is a TiDB extension syntax, used to view the status of TiDB and c - [`ADMIN PLUGINS`](#admin-plugins-related-statement) - [`ADMIN ... BINDINGS`](#admin-bindings-related-statement) - [`ADMIN REPAIR`](#admin-repair-statement) +- [`ADMIN SHOW NEXT_ROW_ID`](#admin-show-next_row_id-statement) - [`ADMIN SHOW SLOW`](#admin-show-slow-statement) ## DDL related statement @@ -135,6 +136,14 @@ Here "untrusted" means that you need to manually ensure that the metadata of the +## `ADMIN SHOW NEXT_ROW_ID` statement + +```sql +ADMIN SHOW t NEXT_ROW_ID; +``` + +The above statement is used to view the details of some special columns of a table. The output is the same as [SHOW TABLE NEXT_ROW_ID](/sql-statements/sql-statement-show-table-next-rowid.md). + ## `ADMIN SHOW SLOW` statement > **Note:** @@ -211,6 +220,22 @@ ADMIN SHOW DDL JOBS 5; +--------+---------+------------+---------------------+----------------+-----------+----------+-----------+-----------------------------------+-----------------------------------+---------------+ ``` +Run the following command to view the details of some special columns of a table. The output is the same as [SHOW TABLE NEXT_ROW_ID](/sql-statements/sql-statement-show-table-next-rowid.md). + +```sql +ADMIN SHOW t NEXT_ROW_ID; +``` + +```sql ++---------+------------+-------------+--------------------+----------------+ +| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE | ++---------+------------+-------------+--------------------+----------------+ +| test | t | _tidb_rowid | 101 | _TIDB_ROWID | +| test | t | _tidb_rowid | 1 | AUTO_INCREMENT | ++---------+------------+-------------+--------------------+----------------+ +2 rows in set (0.01 sec) +``` + Run the following command to view the uncompleted DDL jobs in the test database. The results include the DDL jobs that are running and the last 5 DDL jobs that are completed but failed. {{< copyable "sql" >}}