MySQL Forums
Forum List  »  MySQL Administrator

Long running query concern
Posted by: Charles Nack
Date: February 22, 2010 05:54PM

My sql query is taking a bit of time to run for the size of my database and is a small concern. It took about 1 full second to return the results in phpmyadmin running this. Problem is that on the site it is going to be run quite often by end users and for performance I was wondering if there is a better way to script this. It may be a design flaw in my database. Please let me know if you need anymore details.

Table GameScoring: 3800 records
Game: 800 records
Player: 800 records
Other tables have less then 20

SELECT Player.PlayerID, Team.SchoolName, Team.Mascot, Player.PlayerFirst, Player.PlayerLast, COUNT( GameScoring.GoalID ) AS Points, Division.DLongDesc
FROM GameScoring
INNER JOIN Game ON GameScoring.GameID = Game.GameID
INNER JOIN Team ON GameScoring.TeamID = Team.TeamID
INNER JOIN Division ON Team.DivisionID = Division.DivisionID
INNER JOIN Player ON ( GameScoring.Scorer = Player.PlayerID
OR GameScoring.Assist1 = Player.PlayerID
OR GameScoring.Assist2 = Player.PlayerID )
WHERE Team.DivisionID =1
AND Game.SeasonID =6
GROUP BY Player.PlayerID

Options: ReplyQuote

Written By
Long running query concern
February 22, 2010 05:54PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.