From: Ant Zucaro Date: Sun, 25 Sep 2022 00:06:04 +0000 (-0400) Subject: Handle inactive players or servers in materialized views. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=004aec7ad6fb142504685041e0f32335a23fe2e0;p=xonotic%2Fxonstatdb.git Handle inactive players or servers in materialized views. --- diff --git a/scripts/refresh_active_servers_mv.sql b/scripts/refresh_active_servers_mv.sql index 05bdf7b..10c8847 100644 --- a/scripts/refresh_active_servers_mv.sql +++ b/scripts/refresh_active_servers_mv.sql @@ -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 diff --git a/scripts/refresh_player_agg_stats_mv.sql b/scripts/refresh_player_agg_stats_mv.sql index cf99aa5..b75f064 100644 --- a/scripts/refresh_player_agg_stats_mv.sql +++ b/scripts/refresh_player_agg_stats_mv.sql @@ -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,