Since you have your request now, you use EACH for the game and all the games under it for each player ... So, for example, if you had 10 games per person, you get the following results for the season / person
Game 10, Game 10 points, avg of games 1-9 Game 9, Game 9 points, avg of games 1-8... ... ... Game 2, Game 2 points, avg of thus final game 1 only.
You stated that you want the latest game with an average of everything below it. However, I assume that you DO NOT care about each of the lower levels of the game per person.
You also complete a query covering ALL seasons. If the season is over, do you like the old seasons? or only in the current season. Otherwise, you will go through all seasons, all players ...
All that said, I propose the following. First, restrict the query to any last season using the WHERE clause, but I STRONGLY leave the season in the query / group in case you want other seasons. Then I get the MAXIMUM game for a given person / season as the baseline for the final 1 row (for each season), and then gets the average of all this. Thus, in the example scenario from 10 games to 2, I will not capture the base lines 9-2, just returning the game number 10 in my scenario.
select pgMax.Player_ID, pgMax.Season_ID, pgMax.mostRecentGameID, pgl3.points as mostRecentGamePoints, pgl3.player_name, coalesce( avg( pgl2.points ), 0 ) as AvgPointsPriorToCurrentGame from ( select pgl1.player_id, pgl1.season_id, max( pgl1.game_id ) as mostRecentGameID from player_gameLogs pgl1 where pgl1.season_id = JustOneSeason group by pgl1.player_id, pgl1.season_id ) pgMax JOIN player_gamelogs pgl pgl2 on pgMax.player_id = pgl2.player_id AND pgMax.season_id = pgl2.season_id AND pgMax.mostRecentGameID > pgl2.game_id JOIN player_gamelogs pgl pgl3 on pgMax.player_id = pgl3.player_id AND pgMax.season_id = pgl3.season_id AND pgMax.mostRecentGameID = pgl3.game_id group by pgMax.Player_ID, pgMax.Season_ID order by pgMax.Player_ID
Now, to optimize a query, a composite index will be best used (player_id, season_id, game_id, points). HOWEVER, if you are looking only for what was in the current season, indicate your index on (season_id, player_id, game_id, points) by inserting the SEASON ID in the first position to pre-qualify the WHERE clause.