Page 1 of 1

sql statements

Posted: Fri Jan 31, 2003 11:51 am
by tennis_blues
hi,
i am fairly new to mysql. can someone please point me in the right direction?

i have an SQL statement that queries multiple tables. does it matter how order the clauses in the where statement. i want the query to be as fast as possible.

here is an example:
SELECT Team.TeamName, Club.ClubName
FROM Team, Club
WHERE Team.TeamID = $TeamID and
Team.ClubID = Club.ClubID

I have TeamID indexed on the Team table and ClubID indexed on the Club table.

so, would my query be faster if i rearranged the where clause somehow? and if so, how should i rearrange it, please?

thanks so much!

Posted: Fri Jan 31, 2003 4:00 pm
by fractalvibes
You might consider adding an index on the team.clubid

Phil J