有聯(lián)合索引 idx_f1234 (f1, f2, f3, f4)
查詢語句 select * from ~ where f1= ~ and f2 = ~ order by f3, f4 (或group by f3, f4) 聯(lián)合索引是生效的
show INDEX from practice_answer;
EXPLAIN
SELECT * from practice_answer where `status` = 0 and practice_id = 509 limit 100;
EXPLAIN
SELECT * from practice_answer where `status` = 0 and practice_id = 509 ORDER BY create_time, user_id desc limit 100;
等有時間細化