I have the following query which collects data from 3 tables:
bettingoffer has about 40.000 entries,
event has about 1300 entries, and
outcome has about 40.000 entries
$q = "SELECT bettingoffer.odds FROM bettingoffer, outcome, event WHERE bettingoffer.outcomeId=outcome.object_id AND event.object_id=outcome.eventId AND outcome.eventId='".$m_id."' AND outcome.typeId='".$type_id."' AND outcome.integerParameter='".$t_id."' AND outcome.scopeId='".$scope_id."' ORDER BY bettingoffer.odds DESC LIMIT 1 ";
This will take around 10 seconds for providing odds for about 20 events (matches). I've tried running the query for all matches but i stopped it after 3 minutes with the page white and still loading, which means something is wrong...
What could i do in order to improve the time of the query execution?