in Web

Optimise log

Access speed of 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…

Write a Comment


To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see

This site uses Akismet to reduce spam. Learn how your comment data is processed.