]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Don't put anonymous players in games.players
authorAnt Zucaro <azucaro@gmail.com>
Sat, 7 Nov 2015 15:15:54 +0000 (10:15 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 7 Nov 2015 15:15:54 +0000 (10:15 -0500)
The "games" table has a convenience, de-normalized column for storing the list
of player_ids who played in that game. This is intended for use in quick
searches. Since anonymous players (players having a player_id == 2) aren't
searchable, they don't need to be in this list. This should decrease the
overall size of the GIN index on that column over time.

xonstat/views/submission.py

index 12e1c65d67d4f435947115a48d1f1fc94f033f2d..18ff0057d873387c8902cfc8ce9fbe33e1f7c0b5 100644 (file)
@@ -912,6 +912,8 @@ def submit_stats(request):
             if player.player_id > 1:
                 anticheats = create_anticheats(session, pgstat, game, player,
                     events)
+
+            if player.player_id > 2:
                 player_ids.append(player.player_id)
 
             if should_do_weapon_stats(game_type_cd) and player.player_id > 1: