Optimise log



Access speed of Ourcoders.com was always very slow. So I turn on mysql slow queries function. I found out there was a SQL statement, “SELECT * FROM mail_queue WHERE status = 0 ORDER BY rand() ASC”, case almost 90% slow queries.

And I think “ORDER BY rand() ASC” is not very important, so I remove it, and success reduce the slow queries rates.

And I remove the old slow queries logs, after one day, I found there was some new mainly slow queries, like that “SELECT id,title,replys FROM threads where createbyid <> 28504 AND id in (SELECT threadid FROM thread_replys WHERE userid = 28504 and del = 0 GROUP BY threadid) AND del = 0″. And I think the function using this sql is not important either, so I just remove the function.

Ok, now just let the bullet flies…