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 .
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.
精彩评论