开发者

MySQL, how can I speed up this query which takes 1.4 second?

How can I speed up this query ?

SELECT PadID, CatID, IconSoureURL, OsStr, PadURL, PageName, ProgramName,  
ProgramVersion, ReleaseStatus, English45, License, DownloadURL
FROM Pads
WHERE RemoveMeDate开发者_如何学运维 = '2001-01-01 00:00:00'
ORDER BY VersionAddDate DESC
LIMIT 360 , 40

I already have an index, heres the query explained .

MySQL, how can I speed up this query which takes 1.4 second?


Make an index on RemoveMeDate and VersionDate
CREATE INDEX new_index ON (RemoveMeDate, VersionDate);
you must ensure that the order by is done on a index ( index on RemoveMeDate and VersionDate should do that - RemoveMeDate part of the index will be used by where and VersionDate part of the index will be used by order by)


Do you have an index on RemoveMeDate though?


VersionAddDate should have index, not good to sort on non-indexed column.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜