TiDB4.0.4 analyze table hang

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】

4.0.4
【问题描述】
在analyze table 时 hang 住,可以hang几天,一直处于runing状态,重启tidb 实例后又正常了,不知道是什么原因,如何避免,TIDB版本: 4.0.4。想知道原因以及如何避免。analyze table 表的数据量3~4百万的规模。 其它功能正常,能读能写,数据库负荷很低,CPU不超过20%。


若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

tidb-log.zip (1014.1 KB)

profile.zip (3.3 MB)

mysql> show analyze status;
±-------------------±------------------±---------------±-------------------------------------±---------------±--------------------±---------+
| Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | State |
±-------------------±------------------±---------------±-------------------------------------±---------------±--------------------±---------+
| platform_address_6 | addr_layer_info_0 | | auto analyze index idx_gates_code | 1290240 | 2021-04-15 22:57:04 | finished |
| platform_address_6 | addr_layer_info_0 | | auto analyze index idx_building_code | 1290240 | 2021-04-15 22:57:08 | finished |
| platform_address_6 | addr_layer_info_0 | | auto analyze index idx_addr_code | 1290240 | 2021-04-15 22:57:10 | finished |
| platform_address_6 | addr_layer_info_0 | | auto analyze index idx_tenant_id | 1290240 | 2021-04-15 22:57:11 | finished |
| platform_address_5 | addr_gates_info_0 | | auto analyze columns | 1313744 | 2021-04-15 23:12:30 | finished |
| platform_address_5 | addr_gates_info_0 | | auto analyze index idx_street_code | 1313744 | 2021-04-15 23:12:45 | finished |
| platform_address_5 | addr_gates_info_0 | | auto analyze index idx_turnout_code | 1313744 | 2021-04-15 23:12:46 | finished |
| platform_address_5 | addr_gates_info_0 | | auto analyze index idx_addr_code | 1313744 | 2021-04-15 23:12:50 | finished |
| platform_address_5 | addr_gates_info_0 | | auto analyze index idx_tenant_id | 1313744 | 2021-04-15 23:12:53 | finished |
| platform_address_7 | addr_gates_info_0 | | auto analyze columns | 1424659 | 2021-04-15 23:14:30 | finished |
| platform_address_7 | addr_gates_info_0 | | auto analyze index idx_street_code | 1424659 | 2021-04-15 23:14:46 | finished |
| platform_address_7 | addr_gates_info_0 | | auto analyze index idx_turnout_code | 1424659 | 2021-04-15 23:14:49 | finished |
| platform_address_7 | addr_gates_info_0 | | auto analyze index idx_addr_code | 1424659 | 2021-04-15 23:14:53 | finished |
| platform_address_7 | addr_gates_info_0 | | auto analyze index idx_tenant_id | 1424659 | 2021-04-15 23:14:55 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze columns | 1374083 | 2021-04-15 23:16:15 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze index idx_turnout_code | 1374083 | 2021-04-15 23:16:49 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze index idx_gates_code | 1374083 | 2021-04-15 23:16:50 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze index idx_building_code | 1374083 | 2021-04-15 23:16:52 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze index idx_addr_code | 1374083 | 2021-04-15 23:16:54 | finished |
| platform_address_5 | addr_layer_info_0 | | auto analyze index idx_tenant_id | 1374083 | 2021-04-15 23:16:56 | finished |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 412815528 | 2021-04-16 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 494805397 | 2021-04-17 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 539933631 | 2021-04-18 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 410646197 | 2021-04-19 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 424474406 | 2021-04-20 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 396265980 | 2021-04-21 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 374966761 | 2021-04-22 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 435493803 | 2021-04-23 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 464839069 | 2021-04-24 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 325885014 | 2021-04-25 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 355233697 | 2021-04-26 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 327951794 | 2021-04-27 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 388403094 | 2021-04-28 07:20:01 | running |
| rkw_ezc_prod | wpt_jbdjxx | | fast analyze columns | 1023266356 | 2021-04-29 07:20:01 | running |
| platform_address_1 | addr_gates_info_0 | | fast analyze columns | 37311844 | 2021-04-29 10:50:53 | running |
| rkw_uims_prod | sys_user | | fast analyze columns | 0 | 2021-04-29 16:52:17 | running |
| rkw_uims_prod | sys_user | | fast analyze columns | 0 | 2021-04-29 16:58:25 | running |
| rkw_uims_prod | sys_dept | | fast analyze columns | 0 | 2021-04-29 16:59:58 | running |
±-------------------±------------------±---------------±-------------------------------------±---------------±--------------------±---------+
38 rows in set (0.00 sec)

  1. 是手动同时执行多个 analyze 操作么?
  2. 重启 tidb 实例之后又正常了,是指重启之后,再次执行 analyze 操作可以正常执行?