From e42a5835537f9afbc053da7bf24b48d9f9b0d67e Mon Sep 17 00:00:00 2001
From: Matthew Somerville <matthew@cake.ukcod.org.uk>
Date: Wed, 12 May 2010 12:57:26 +0100
Subject: Some indices on the alert table.

---
 db/schema.sql | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index 7b1bee1c6..f27d3dce7 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -286,7 +286,11 @@ create table alert (
     whensubscribed timestamp not null default ms_current_timestamp(),
     whendisabled timestamp default null
 );
--- Possible indexes - email, alert_type, whendisabled, unique (alert_type,email,parameter)
+create index alert_email_idx on alert(email);
+create index alert_alert_type_confirmed_whendisabled_idx on alert(alert_type, confirmed, whendisabled);
+create index alert_whendisabled_cobrand_idx on alert(whendisabled, cobrand);
+create index alert_whensubscribed_confirmed_cobrand_idx on alert(whensubscribed, confirmed, cobrand);
+-- Possible indexes - unique (alert_type,email,parameter)
 
 create table alert_sent (
     alert_id integer not null references alert(id),
-- 
cgit v1.2.3

