dbTalk Databases Forums  

Slow query problem

comp.databases.mysql comp.databases.mysql


Discuss Slow query problem in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GregAgee@gmail.com
 
Posts: n/a

Default Slow query problem - 01-11-2007 , 05:05 PM






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.

Quote:
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.



Reply With Quote
  #2  
Old   
Nicholas Sherlock
 
Posts: n/a

Default Re: Slow query problem - 01-11-2007 , 06:41 PM






GregAgee (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
  #3  
Old   
GregAgee@gmail.com
 
Posts: n/a

Default Re: Slow query problem - 01-11-2007 , 07:10 PM



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

Nicholas Sherlock wrote:

Quote:
How much data are you retrieving from the remote server?

Cheers,
Nicholas Sherlock

--
http://www.sherlocksoftware.org


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.