SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Testing speed of mysql query

    I have been seeing people posting about the speed of various mysql queries that they have and I'm curious how do I find the speed? Could someone show me an example?

  2. #2
    SitePoint Enthusiast ptolemy's Avatar
    Join Date
    Feb 2002
    Location
    Geneva, Switzerland
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by FreebieGuy
    I have been seeing people posting about the speed of various mysql queries that they have and I'm curious how do I find the speed? Could someone show me an example?
    Searches for questions like this often reveal some insightful answers to questions. Here's what I found from google: http://www.phpbuilder.com/lists/php-...02062/0914.php


  3. #3
    SitePoint Evangelist
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for pointing me to it.

  4. #4
    SitePoint Evangelist
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just wondering if the time returned for that article is returned in seconds.

  5. #5
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you have phpmyadmin, it's a reasonably good way to test a query. It tells you how long the query took, and it lets you turn a "select" into an "explain" and back so you can see what the query's doing. The only problem is that it always adds a "limit" clause which can affect the query's speed of operation.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  6. #6
    SitePoint Evangelist
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "It tells you how long the query took"
    Erm... which version of phpMyAdmin are you using? My webhost does not seem to state the execution time.

  7. #7
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm running 2.5.5, but I'm pretty sure it's been a feature of phpmyadmin for a long time. When you do an SQL query.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  8. #8
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could download the latest phpMyAdmin and install it yourself, it should work even on shared hosting environment.
    http://www.phpmyadmin.net/

    As for the speed of query, it's very fast for most of the cases. To know the details on why it's slow, try use EXPLAIN query
    http://www.mysql.com/doc/en/EXPLAIN.html

    To have MySQL log slow queries, you could modify my.cnf
    log-slow-queries=/var/log/mysqld.slow.log
    long_query_time=5 (5 secs)
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •