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
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)