Show us the output of "
EXPLAIN SELECT a.a_id, a.a_area, a.a_code FROM (
SELECT ads.a_id, ads.a_area, ads.a_code
FROM ads, adtags, tags
WHERE ads.a_id = adtags.at_aid AND adtags.at_tid=tags.t_id
AND tags.t_name IN ('sponsor1','big tits','milf','lisa ann','anal','default')
AND ads.a_area IN (3,5,6,4)
ORDER BY ads.a_imp ASC
) AS a
GROUP BY a.a_area;"
Actually one of the worst things you are doing here is the "GROUP BY" which will cause a tmp table generation which when run in high concurrency will slam disk i/o and stack queries up resulting in longer processing times.
|