View Single Post
Old 07-19-2011, 12:30 AM  
dubsix
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Posts: 363
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.
dubsix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote