From: Ant Zucaro <azucaro@gmail.com>
Date: Tue, 16 Mar 2021 21:59:17 +0000 (-0400)
Subject: Create the index on the new table, not the old one.
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d76049665408842ab5a42ff2bd9b9875bdc26a8b;p=xonotic%2Fxonstatdb.git

Create the index on the new table, not the old one.
---

diff --git a/scripts/refresh_recent_game_stats_mv.sql b/scripts/refresh_recent_game_stats_mv.sql
index 8ab8211..a158640 100644
--- a/scripts/refresh_recent_game_stats_mv.sql
+++ b/scripts/refresh_recent_game_stats_mv.sql
@@ -16,8 +16,8 @@ BEGIN;
     AND g.create_dt BETWEEN (now() at time zone 'UTC' - interval '30 days') AND (now() at time zone 'UTC' + interval '1 day');
 
     -- Index it
-    CREATE INDEX recent_game_stats_mv_new_ix001 on recent_game_stats(server_id);
-    CREATE INDEX recent_game_stats_mv_new_ix002 on recent_game_stats(map_id);
+    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 TABLE IF EXISTS recent_game_stats_mv CASCADE;