From d76049665408842ab5a42ff2bd9b9875bdc26a8b Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Tue, 16 Mar 2021 17:59:17 -0400 Subject: [PATCH] Create the index on the new table, not the old one. --- scripts/refresh_recent_game_stats_mv.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.2