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;使用不到索引 想知道是因为什么