/sql-statements/sql-statement-show-analyze-status.md

https://github.com/pingcap/docs · Markdown · 53 lines · 38 code · 15 blank · 0 comment · 0 complexity · 2294629265d22be9e137065a926b52d1 MD5 · raw file

  1. ---
  2. title: SHOW ANALYZE STATUS
  3. summary: An overview of the usage of SHOW ANALYZE STATUS for the TiDB database
  4. aliases: ['/docs/dev/sql-statements/sql-statement-show-analyze-status/']
  5. ---
  6. # SHOW ANALYZE STATUS
  7. The `SHOW ANALYZE STATUS` statement shows the statistics collection tasks being executed by TiDB and a limited number of historical task records.
  8. ## Synopsis
  9. **ShowStmt:**
  10. ![ShowStmt](/media/sqlgram/ShowStmt.png)
  11. **ShowTargetFilterable:**
  12. ![ShowTargetFilterable](/media/sqlgram/ShowTargetFilterable.png)
  13. ## Examples
  14. {{< copyable "sql" >}}
  15. ```sql
  16. create table t(x int, index idx(x)) partition by hash(x) partition 4;
  17. analyze table t;
  18. show analyze status;
  19. ```
  20. ```sql
  21. +--------------+------------+----------------+-------------------+----------------+---------------------+----------+
  22. | Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | State |
  23. +--------------+------------+----------------+-------------------+----------------+---------------------+----------+
  24. | test | t | p1 | analyze columns | 0 | 2020-05-25 17:23:55 | finished |
  25. | test | t | p0 | analyze columns | 0 | 2020-05-25 17:23:55 | finished |
  26. | test | t | p0 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished |
  27. | test | t | p1 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished |
  28. | test | t | p2 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished |
  29. | test | t | p3 | analyze index idx | 0 | 2020-05-25 17:23:55 | finished |
  30. | test | t | p3 | analyze columns | 0 | 2020-05-25 17:23:55 | finished |
  31. | test | t | p2 | analyze columns | 0 | 2020-05-25 17:23:55 | finished |
  32. +--------------+------------+----------------+-------------------+----------------+---------------------+----------+
  33. 8 rows in set (0.00 sec)
  34. ```
  35. ## MySQL compatibility
  36. This statement is a TiDB extension to MySQL syntax.
  37. ## See also
  38. * [ANALYZE_STATUS table](/information-schema/information-schema-analyze-status.md)