I have a site that displays nordic ski and cross-country running results and, in times of high volume, the results render slowly. I would like to know how to optimize the query and set indexes. We did this with my fitness events database but now I need to do that with the cc meet database and I am not sharp enough to do it alone. Here is a query to start with:
sql = "SELECT r.LastName, r.FirstName, t.TeamName, r.RosterID, r.Gender, ir.RaceTime, ir.Excludes, ir.TeamPlace, ir.Bib "
sql = sql & "FROM Roster r INNER JOIN Grades g ON r.RosterID = g.RosterID INNER JOIN IndRslts ir ON r.RosterID = ir.RosterID "
sql = sql & "INNER JOIN Teams t ON t.TeamsID = r.TeamsID WHERE ir.RacesID = " & lRaceID & " AND ir.Place <> 0 AND ir.RaceTime <> '00:00' "
sql = sql & "ORDER BY ir.Place"
What do you need to know about the tables in order to help me? Sorry for asking a similar question but I just am having a hard time bridging the two.