Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
Slow query problem
Old
  (#1)
Guest
Guest
 
Posts: n/a
Default Slow query problem - 06-04-2007, 07:46 AM

Here is the situation: I have a web server pointing to a database on a
different server. When a query is made from the web server to the
database server, it takes like 30 seconds to complete. However, when I
execute the exact same query from the command line (on the same
computer as the web server) it completes instantly.

>From the db server, I monitor 'mytop' to see what the deal is and I

find that when the query is being executed from the web, it stays in
the table for 30 seconds, or so, until it completes. So, it looks like
the connection between the web server and the db server is not the
issue; rather, it is something to do with the way it is executed? I'm
not sure. Does anyone have any ideas about how to fix this problem?

Thanks in advance.

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Slow query problem
Old
  (#2)
Nicholas Sherlock
Guest
 
Posts: n/a
Default Re: Slow query problem - 06-04-2007, 07:46 AM

EMAIL REMOVED wrote:
> Here is the situation: I have a web server pointing to a database on a
> different server. When a query is made from the web server to the
> database server, it takes like 30 seconds to complete. However, when I
> execute the exact same query from the command line (on the same
> computer as the web server) it completes instantly.


How much data are you retrieving from the remote server?

Cheers,
Nicholas Sherlock

--
http://www.sherlocksoftware.org
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Slow query problem
Old
  (#3)
Guest
Guest
 
Posts: n/a
Default Re: Slow query problem - 06-04-2007, 07:46 AM

I am an idiot. I never indexed any of the necessary rows. Now
everything is fantastic. Thanks for replying.

Nicholas Sherlock wrote:

> How much data are you retrieving from the remote server?
>
> Cheers,
> Nicholas Sherlock
>
> --
> http://www.sherlocksoftware.org


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top