All pastes #29843 Raw Edit

Anonymous

public text v1 · immutable
#29843 ·published 2005-11-21 01:55 UTC
rendered paste body
Showing rows 0 - 8 (9 total, Query took 4.6116 sec)
SQL query: 
SELECT offers.*
FROM offers
LEFT JOIN completions ON offers.offerid = completions.offerid
AND completions.userid =2
WHERE offers.active =1
AND completions.offerid IS NULL
ORDER BY offers.completions DESC
LIMIT 9 

offers = 550 rows
completions = 3500 rows

explaining: 
table  	 type  	 possible_keys  	 key  	 key_len  	 ref  	 rows  	 Extra
offers 	ALL 	NULL 	NULL 	NULL 	NULL 	545 	Using where; Using temporary; Using filesort
completions 	ALL 	NULL 	NULL 	NULL 	NULL 	3983 	Using where; Not exists