diff --git a/TOC.md b/TOC.md index 05748a5c41bf0..4bc43cce47ee5 100644 --- a/TOC.md +++ b/TOC.md @@ -257,6 +257,7 @@ + [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) + [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) + [`SET [GLOBAL|SESSION] `](/sql-statements/sql-statement-set-variable.md) + + [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) + [`SHOW [BACKUPS|RESTORES]`](/sql-statements/sql-statement-show-backups.md) + [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) + [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) diff --git a/sql-statements/sql-statement-show-analyze-status.md b/sql-statements/sql-statement-show-analyze-status.md new file mode 100644 index 0000000000000..3bcad59f18338 --- /dev/null +++ b/sql-statements/sql-statement-show-analyze-status.md @@ -0,0 +1,49 @@ +--- +title: SHOW ANALYZE STATUS +summary: An overview of the usage of SHOW ANALYZE STATUS for the TiDB database。 +category: reference +--- + +# SHOW ANALYZE STATUS + +The `SHOW ANALYZE STATUS` statement shows the statistics collection tasks being executed by TiDB and a limited number of historical task records. + +## Synopsis + +**ShowStmt:** + +![ShowStmt](/media/sqlgram/ShowStmt.png) + +**ShowTargetFilterable:** + +![ShowTargetFilterable](/media/sqlgram/ShowTargetFilterable.png) + +## Examples + +{{< copyable "sql" >}} + +```sql +create table t(x int, index idx(x)) partition by hash(x) partition 4; +analyze table t; +show analyze status; +``` + +```sql ++--------------+------------+----------------+-------------------+----------------+---------------------+----------+ +| Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | State | ++--------------+------------+----------------+-------------------+----------------+---------------------+----------+ +| test | t | p1 | analyze columns | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p0 | analyze columns | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p0 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p1 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p2 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p3 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p3 | analyze columns | 0 | 2020-05-25 17:23:55 | finished | +| test | t | p2 | analyze columns | 0 | 2020-05-25 17:23:55 | finished | ++--------------+------------+----------------+-------------------+----------------+---------------------+----------+ +8 rows in set (0.00 sec) +``` + +## See also + +* [ANALYZE_STATUS table](/system-tables/system-table-information-schema.md#analyze_status-table)