View Single Post
Old 10-10-2012, 01:13 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Probably, you are just missing some indexes that are needed to bring the query up to a reasonable speed.

At a MINIMUM you need indexes on the following table.fields:

-- completed_offers.username
-- offers.offerid
-- offers.category

But having said that... That query sure looks like it is more complex than is needed!

Do you really want to return offers.category if the howmany value will be zero?

And do you really need to use LIKE in that WHERE countries LIKE ...??

PLEASE don't tell me that your contries field is actually a LIST of countries! Please say it isn't something like Austria,Australia,Belgium ... please?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote