mysql> create index idx_order_id on bot_order (order_id);
ERROR 1061 (42000): index already exist idx_order_id
mysql> create index idx_strategy_type on bot_order (strategy_type);
Query OK, 0 rows affected (3.01 sec)
mysql> set global tidb_auto_analyze_ratio=0.2;
Query OK, 0 rows affected (0.03 sec)
mysql> set global tidb_auto_analyze_start_time=‘00:00 +0800’;
Query OK, 0 rows affected (0.03 sec)
mysql> set global tidb_auto_analyze_end_time=‘06:00 +0800’;
Query OK, 0 rows affected (0.02 sec)
mysql> set global ### tidb_enable_pseudo_for_outdated_stats
->
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 10 near “”
mysql> set global tidb_enable_pseudo_for_outdated_stats=off;
然后需要那几张表就更新那几张表的统计信息。这样不会向你这样大幅度变慢
analyze table xxx;