From b425984cd97df69a458072c49c5ff767f44141c0 Mon Sep 17 00:00:00 2001 From: poveyd <32199157+poveyd@users.noreply.github.com> Date: Tue, 5 May 2020 11:11:21 +0100 Subject: [PATCH] Update cycle_notification_history_in_batches.sql --- database_maintenance/cycle_notification_history_in_batches.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/database_maintenance/cycle_notification_history_in_batches.sql b/database_maintenance/cycle_notification_history_in_batches.sql index dc0651dc2..690a9e28a 100644 --- a/database_maintenance/cycle_notification_history_in_batches.sql +++ b/database_maintenance/cycle_notification_history_in_batches.sql @@ -1,5 +1,7 @@ -- Call once at the start of the process +create index created_id_nh on notification_history (created_at, id); + CREATE TABLE notification_history_pivot AS SELECT * from notification_history WHERE 1=2; CREATE TEMPORARY TABLE nh_temp AS SELECT id FROM notification_history;