Skip to content

Commit

Permalink
cherry pick #2856 to release-4.0 (#2874)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>

Co-authored-by: Shenghui Wu <[email protected]>
  • Loading branch information
ti-srebot and wshwsh12 authored Jun 15, 2020
1 parent 2b2ebb7 commit cd99611
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] <variable>`](/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)
Expand Down
49 changes: 49 additions & 0 deletions sql-statements/sql-statement-show-analyze-status.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit cd99611

Please sign in to comment.