]> git.xonotic.org Git - xonotic/xonstatdb.git/commitdiff
Handle inactive players or servers in materialized views.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 25 Sep 2022 00:06:04 +0000 (20:06 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 25 Sep 2022 00:06:04 +0000 (20:06 -0400)
scripts/refresh_active_servers_mv.sql
scripts/refresh_player_agg_stats_mv.sql

index 05bdf7ba6d96e7a400d9396d1317b8366ac81960..10c8847004a61c22f5a43d2fbc05f589ac2cb638 100644 (file)
@@ -10,6 +10,7 @@ begin
     from servers s join games g on g.server_id = s.server_id
     join player_game_stats pgs on g.game_id = pgs.game_id
     where pgs.player_id > 1
+    and s.active_ind = true
     and g.create_dt > cutoff
     and pgs.create_dt > cutoff
     group by s.server_id, s.name
index cf99aa518bafda700fe5506871f380115218b6cf..b75f0641e6cccc1ba3b5deb9372b3034478d34c6 100644 (file)
@@ -76,6 +76,8 @@ begin
     join
        players p 
           on p.player_id = agg_stats.player_id            
+       where
+          p.active_ind = true
        group by
           p.player_id,
           p.nick,