List:General Discussion« Previous MessageNext Message »
From:mos Date:January 13 2010 4:31pm
Subject:Re: mysql query takes too much time to run
View as plain text  
At 07:00 AM 1/13/2010, F.A.I.Z.A.L wrote:
>where (
>ATX_Status.Status like '%running%' or ATX_Status.Status like '%queued%' or
>ATX_Status.Status like '%migrating%' or ATX_Status.Status like '%loading%'
>or
>ATX_Status.Status like '%configuring%' or ATX_Status.Status like
>'%activating%' )

It looks like it is doing a full table scan on ATX_Status because you have 
started the comparison value with '%....'. It would be faster if you could 
do an exact match. Try replacing this "(    )" part of the Where clause 
with just  " (ATX_Status.Status = 'xxxx')"

where xxxx is a valid status like 'running'. Also do an Explain on your SQL 
statement to see which indexes it is using. You need to simplify the SQL 
statement until it starts running fast again to see what is causing the 
slow down.  Perhaps rebuild the query with one table join at a time.

Remember to run a "Reset Query Cache" between benchmarks to eliminate the 
query cache.

Mike 

Thread
mysql query takes too much time to runF.A.I.Z.A.L13 Jan
  • Re: mysql query takes too much time to runClaudio Nanni13 Jan
  • Re: mysql query takes too much time to runmos13 Jan