Hello,
I created a stats program, what happens is our Statistician puts all of his infromation into an MS Access database, and he uses a program to convert the access database into an SQL file. He then uploads the SQL file to the server, and I run a query on a table, that contains over 10 thousand recoards. When we do this MySQL will crash sometimes. I will paste the query here.
Code:
CREATE TABLE tmp_player_2 AS SELECT `Players`.`PID`, sum(`Players`.`GP`) AS `SumOfGamesPlayed`, sum(`Players`.`G`) AS `SumOfGoals`, sum(`Players`.`A`) AS `SumOfAssists`, sum(`Players`.`PIM`) AS `SumOfPIM`, sum(`Players`.`PTS`) AS `SumOfPTS`, sum(`Players`.`PPG`) AS `SumOfPowerPlayGoals`, sum(`Players`.`SHG`) AS `ShortHandedGoals`, sum(`Players`.`ENG`) AS `SumOfEmptyNetGoals`, sum(`Players`.`GW`) AS `SumOfGameWinner`, sum(`Players`.`TG`) AS `SumOfTG`, sum(`Players`.`IG`) AS `SumOfIG`, sum(`G`) / sum(`GP`) AS `SumOfGoalsPerGame`, sum(`PTS`) / sum(`GP`) AS `SumOfPointsPerGame`, sum(`PIM`) / sum(`GP`) AS `SumOfPIMPG`, `Player_IDS`.`Pos`, `Player_IDS`.`No`, `Player_IDS`.`TID` As TID, `Player_IDS`.`Name`, `Player_IDS`.`Rookie`, `Team_IDS`.`Team` FROM `Players` INNER JOIN `Team_IDS` ON (`Player_IDS`.`TID` = `Team_IDS`.`TID`) INNER JOIN `Player_IDS` ON (`Players`.`PID` = `Player_IDS`.`PID`) INNER JOIN `Games` ON (`Players`.`Game` = `Games`.`Game_ID`) WHERE (`Games`.`Type` = 2) GROUP BY `Players`.`PID
What would u recomend me do to this query that will make it work better? Also this query is ran 6 times total, with a rest of 20 seconds between all of them, but it will only crash on the 10 thounsand recoard table.
We are running MySQL 4.0.23-standard. Our server is a 3GHz, with 1GB of ram.