联合索引失效

table: CREATE TABLE ss_robot_task_statistics_data_origin ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘主键ID’, type int(8) unsigned NOT NULL, status tinyint(3) unsigned NOT NULL, create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ( id ), KEY idx_create_time_type_status ( create_time , type , status ) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=864650805;

“explain select * from urobot.ss_robot_task_statistics_data_origin where create_time= ‘2019-01-01’ and type = 1 and status = 1;” 可以使用索引 "explain select * from urobot.ss_robot_task_statistics_data_origin where create_time= ‘2019-01-01’ ;"it doesnt work;使用不到索引 想知道是因为什么

您好,

为提高效率,提问时请按照提问模板填一下基本信息

  1. 麻烦提供下 tidb 版本
  2. 请贴下 两个语句的 EXPLAIN ANALYZE

explain ANALYZE select * from urobot.ss_robot_task_statistics_data_origin where create_time= ‘2019-01-01’ and type = 1 and status = 1;

explain ANALYZE select * from urobot.ss_robot_task_statistics_data_origin where create_time= ‘2019-01-01’ ;

你好, 我这边可能是我看错了返回结果。当我再次尝试执行这两句sql的时候发现是走了索引的。 不好意思,打扰了,感谢帮助

ok~