SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    .5 seconds for a simple mysql select??

    Hi,

    I've got a table (info) with 19 rows and 11 columns with object_id as the primary key. I've begun saving query times to begin to get a sense as to how long queries take, and this one:

    SELECT language FROM info WHERE object_id = '2'

    just took .46 seconds. Could there be any reason for such a slow query aside from the fact that I'm on shared hosting and resources may be being used by others?

    Thanks!

    -Eric

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by kreut View Post
    Hi,

    I've got a table (info) with 19 rows and 11 columns with object_id as the primary key. I've begun saving query times to begin to get a sense as to how long queries take, and this one:

    SELECT language FROM info WHERE object_id = '2'

    just took .46 seconds. Could there be any reason for such a slow query aside from the fact that I'm on shared hosting and resources may be being used by others?

    Thanks!

    -Eric
    Are you sure that is seconds and not milliseconds?

    How are you measuring execution time for the query? Sometimes the method used has an effect on how the time is calculated.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's definitely seconds and I'm using http://framework.zend.com/manual/1.1....profiler.html. Also, when I run it locally, it's lightening fast...

  4. #4
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    934
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @kreut ;

    Did you talk to your web hosting server administrator?
    Better talk to them first and ask them to fix the problem.
    Quality codes are optimized and tested...
    Click here for inspiration..

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion. My hosting service has been fantastic so far and I haven't talked to them yet, as I have to wonder if it's just the "risk" associated with a super cheap plan on any shared hosting plan. Further, my queries are running fast today both locally as well as on my site so I have to wonder again, if it might be just because I'm on a shared hosting plan. And, if I'm truly worried about a faster time (perhaps it's not such a big deal with my current traffic level?), then maybe the solution would be to move to semi-dedicated hosting.

    Any parting thoughts with those with more experience would be appreciated.

    -Eric


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
  •