analyze worker panic

tidb_analyze_version = 2 时,如果执行 ANALYZE 语句后发生 OOM,请设置全局变量 tidb_analyze_version = 1 ,然后进行以下操作之一:

  • 如果 ANALYZE 语句是手动执行的,请手动 analyze 每张需要的表:
select distinct(concat('ANALYZE ',table_schema, '.', table_name,';')) from information_schema.tables, mysql.stats_histograms where stats_ver = 2 and table_id = tidb_table_id ;
  • 如果 ANALYZE 语句是开启了自动 analyze 后 TiDB 自动执行的,请使用以下 SQL 语句生成 DROP STATS 的语句并执行:
select distinct(concat('DROP STATS ',table_schema, '.', table_name,';')) from information_schema.tables, mysql.stats_histograms where stats_ver = 2 and table_id = tidb_table_id ;