今天運到一個情況,陳述句
SELECT event_time AS checkInTime FROM bt_agent_event
WHERE
agent_id = '300300'
AND create_time > '2018-02-23'
AND `status` = 1
AND skill_id IS NOT NULL
ORDER BY
event_time
LIMIT 1;
資料庫資料大概1000萬左右,用了索引,查詢很慢達到了400秒,但如果去掉limit 1或者order by或者where,這時查詢速度很快,也就零點幾秒。





求解!
uj5u.com熱心網友回復:
去掉limit用的哪個索引強制用這個索引
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/96685.html
標籤:MySQL
上一篇:MySql登錄不了,ERROR 2026 (HY000): SSL connection error: socket layer receive error
下一篇:mongodb 時間聚合分組
