October 1, 2006

Backport of micro-time patch to mysql 4.1

Posted by Vadim

Taking into account 4.1 tree is still popular and is used on many production servers we
decided to make backport of patch to slow-log queries. The patch allows to specify time of slow queries in microseconds and is very helpful in a fight with problematic queries. 4.1 Patch is available here (The original patch was developed by Georg Richter georg at php net)

Related posts: :Microslow patch for 5.0.37::Microslow patch for 5.1.20::Binaries of MySQL 5.0.33 Community release for AMD64 / EM64T:
 

9 Comments »

  1. Thanks. I’m going to use it once I had time.

    Comment :: October 1, 2006 @ 1:39 pm

  2. Thanks.
    Very usfull patch for query profiling.

    Большое спасибо.

    Comment :: October 5, 2006 @ 11:42 am

  3. I patch mysql source, but it doesn’t work.

    I can not set long_query_time=0 . The least value of long_query_time - 1. If I set long_query_time=0, “SHOW VARIABLES;” show me long_query_time=1.

    And I see always seconds in slow log: Query_time: 2 Lock_time: 0 .

    How to turn on the patch?

    Comment :: October 9, 2006 @ 6:03 am

  4. Michael,

    It looks like you are still using unpatched mysqld.

    The procedure is:
    get sources
    patch with: patch -p1 < patch.slow-micro.4.1.21.diff
    ./configure –prefix=/usr/local/mysql-micro …other-options..
    make
    make install

    In /usr/local/mysql-micro you should get binary

    Comment :: October 9, 2006 @ 7:09 am

  5. I do it again, how you write.
    After I run slow query and get this:

    # Time: 061010 0:58:54
    # User@Host: root[root] @ localhost []
    # Query_time: 7 Lock_time: 0 Rows_sent: 1 Rows_examined: 227073
    use mindmix;
    SELECT SQL_CALC_FOUND_ROWS * FROM `topics` WHERE `forum_id` !=1 LIMIT 1;

    Do you have another ideas?

    Comment :: October 9, 2006 @ 2:00 pm

  6. I use MyISAM tables…

    Comment :: October 9, 2006 @ 2:01 pm

  7. Sorry, I find problem.
    I used old mysqld.

    Comment :: October 9, 2006 @ 2:05 pm

  8. Michael,

    Good you’ve found the problem. Regarding query you have in your example it is slow because of SQL_CALC_FOUND_ROWS - it effectively negates the limit.

    Comment :: October 9, 2006 @ 3:00 pm

  9. [...] patch has been there for some time, but only for earlier MySQL editions such as 4.1 and 5.0. Now it’s also available for the latest [...]

    Pingback :: July 18, 2007 @ 12:27 pm

 



Subscribe without commenting