Re: [Semanticscuttle-devel] performance problem with mysql query
Brought to you by:
cweiske
|
From: Christian W. <cw...@cw...> - 2010-09-18 23:45:14
|
Hello Eric, > Mysql is using a file sort on one of the queries used to generate the > homepage.... This is taking about 4 seconds of 100% cpu on my box... > > I'm trying to optimize it, but don't have the required experience. > > Here are the details: > http://stackoverflow.com/questions/3722253/help-removing-mysql-file-sort The query needs to be as follows: SELECT U.username, B.* FROM sc_users AS U, sc_bookmarks AS B WHERE B.uId = U.uId AND B.bStatus = 0 GROUP BY B.bModified DESC, B.bHash DESC ORDER BY B.bModified DESC LIMIT 10 and you should create an index on status+modified+hash. -- Regards/Mit freundlichen Grüßen Christian Weiske -=≡ Geeking around in the name of science since 1982 ≡=- |