What is the best choice for my index on this query?

SELECT          id_team,
                        sum(IF(m.id_visitor = t.id_team,m.visitor_score,
m.home_score)) AS But_pour,
                        sum(IF(m.id_visitor != t.id_team,m.visitor_score,
m.home_score)) AS But_contre
FROM             tab_teams t, tab_matchs m
WHERE           t.id_level =4
AND                (m.id_visitor = t.id_team OR m.id_home = t.id_team) AND
m.season = 2
GROUP BY     id_team;

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
             François Boucher
   [EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to