Query takes long time to execute

2003-06-13 Thread Mark Stringham
I'm querying a table of approximately 42 records based on 3 criteria. The results are 
then displayed in a pop-up window.  When the query is executed the first time -  the 
window opens and stalls for about 3 seconds before the results are displayed.

An example query would be : select * from $table_name where email ='$id';
I'm using the * to retreive about 16 cols of information per row. In this case I have 
indexed the email column. 

I'm looking for faster performance.
Any help is appreciated.

Mark


Re: Query takes long time to execute

2003-06-13 Thread Ryan Fox
On Friday 13 June 2003 09:29 pm, Mark Stringham wrote:
 I'm querying a table of approximately 42 records based on 3 criteria. The
 results are then displayed in a pop-up window.  When the query is executed
 the first time -  the window opens and stalls for about 3 seconds before
 the results are displayed.

Try running your query from the MySQL command line client, and see how it 
takes then.  The querying you describe is quite simple, and shouldn't be 
taking MySQL 3 secs to run.  If the query runs in 0.01 secs on the command 
line, then you know MySQL is not the cause of the delay. :)

If, OTOH, the query actually does take 3 secs to run, start by running 
'explain select * ...', which will tell you how the query is being processed.  
More info in optimizing queries can be found at 
http://www.mysql.com/doc/en/Query_Speed.html .

Ryan

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]