]> git.rm.cloudns.org Git - xonotic/xonstatdb.git/commitdiff
Add the create_dt to the materialized view to support heatmapping.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 1 Aug 2021 11:41:19 +0000 (07:41 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 1 Aug 2021 11:41:19 +0000 (07:41 -0400)
scripts/refresh_recent_game_stats_mv.sql

index a158640d7769e9ff64f9f2f6903047ce1ced3880..142b71854794b8e2f1269ed843f0f6e8ce3f644e 100644 (file)
@@ -3,7 +3,8 @@ BEGIN;
     CREATE TABLE recent_game_stats_mv_new AS
 
     SELECT 
-    pgs.player_game_stat_id, g.game_id, g.server_id, g.map_id, p.player_id, p.nick, pgs.score, pgs.alivetime
+    pgs.player_game_stat_id, g.game_id, g.server_id, g.map_id, p.player_id, p.nick, pgs.score, 
+    pgs.alivetime, g.create_dt
 
     FROM player_game_stats pgs
     INNER JOIN players p USING (player_id)
@@ -19,7 +20,7 @@ BEGIN;
     CREATE INDEX recent_game_stats_mv_new_ix001 on recent_game_stats_mv_new(server_id);
     CREATE INDEX recent_game_stats_mv_new_ix002 on recent_game_stats_mv_new(map_id);
 
-    -- Drop the old stuff, rename the stuff
+    -- Drop the old stuff, rename the new stuff
     DROP TABLE IF EXISTS recent_game_stats_mv CASCADE;
     ALTER TABLE recent_game_stats_mv_new RENAME TO recent_game_stats_mv;
 
@@ -29,4 +30,4 @@ BEGIN;
     DROP INDEX IF EXISTS recent_game_stats_mv_ix002;
     ALTER INDEX recent_game_stats_mv_new_ix002 RENAME to recent_game_stats_mv_ix002;
 
-COMMIT; 
\ No newline at end of file
+COMMIT;