Hi. Suppose I have a query like this:
SELECT t.teams_id,t.user_id,t.tournament_id,t.teamname,u.user_id,u.fname,u.lname FROM ifc_teams t INNER JOIN users u on u.user_id=t.user_id ORDER BY t.teams_id DESC LIMIT 15;
In this, I suppose it’ll help to have indexes on:
1 t.user_id
2 u.user_id
3 t.teams_id
But for 1 and 3, should I have a compound index? Or does the ORDER BY clause expect an index by itself because it only uses one column?