All pastes #640967 Raw Edit

Stuff

public text v1 · immutable
#640967 ·published 2007-07-31 20:35 UTC
rendered paste body
SELECT SQL_NO_CACHE STRAIGHT_JOIN a.id, a.name, a.sitetype, a.shortname, a.primary_cat, c.review_date, c.review_type,
IF (
c.review_status =4
AND c.review_date <=1185865200, c.review_date, a.added
) AS overallDate, c.review_status,f.our_score
FROM tbp_sites a
LEFT JOIN tdb_sites_status b ON a.id = b.siteid
LEFT JOIN tdb_sites_reviews c ON b.reviewid = c.id 
LEFT JOIN tdb_sites_info f ON a.id=f.siteid 
WHERE b.site_status =2 
ORDER BY f.our_score DESC , overallDate DESC
LIMIT 0 , 100


 id  	 select_type  	 table  	 type  	 possible_keys  	 key  	 key_len  	 ref  	 rows  	 Extra
1 	SIMPLE 	a 	ALL 	PRIMARY 	NULL 	NULL 	NULL 	15292 	Using temporary; Using filesort
1 	SIMPLE 	b 	ref 	siteid,site_status 	siteid 	4 	mydb_com.a.id 	1 	Using where
1 	SIMPLE 	c 	eq_ref 	PRIMARY 	PRIMARY 	4 	mydb_com.b.reviewid 	1 	 
1 	SIMPLE 	f 	ref 	PRIMARY,sitei_our_score 	sitei_our_score 	4 	mydb_com.a.id 	1 	Using index


 sitei_our_score  	 INDEX  	 15293   	 Edit   	 Drop   	 siteid
our_score