List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:May 10 1999 4:26pm
Subject:Re: real slow query
View as plain text  
Jay Flaherty wrote:
> 
> Hello,
> 
> Hope someone can help me here. I have a query that is taking
> forever to run. The database has between 2,000 and 3,000 records
> per table and all search fields are indexed. Am I missing something
> or is this supposed to be this slow? Is there a faster way to do
> this? How can I enhance performance? The following query takes
> 4 minutes to run.
> 
> SELECT arrest.identity_id, MAX(photos.photo_file) FROM
> arrest, smt, aliases LEFT JOIN photos ON ((photos.arrest_id
> = arrest.arrest_id) AND (photos.photo_type = 'F')) WHERE
> ((arrest.sex = 'F') AND (arrest.race = 'W')) GROUP BY
> arrest.identity_id
> 
> Thanks in advance for any and all replies.
> Take care of your shoes...
> 
> Jay

Hi Jay

Do you have a KEY (sex,race) on the 'arrest' table?
What does EXPLAIN give you with the above SELECT?

Tschau
Christian

Thread
real slow queryJay Flaherty10 May
  • Re: real slow queryChristian Mack10 May
  • Re: real slow queryJay Flaherty11 May