Jay Flaherty wrote:
> 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
> Thanks in advance for any and all replies.
> Take care of your shoes...
Do you have a KEY (sex,race) on the 'arrest' table?
What does EXPLAIN give you with the above SELECT?