id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE tb_task range idx_data_type_is_deleted idx_data_type_is_deleted 2 24671413 10.00 Using where; Using index
set optimizer_trace="enabled=on"; select count(*) from tb_task where is_deleted = 0 and data_type != 1; select * from information_schema.optimizer_trace; set optimizer_trace="enabled=off";