aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@cake.ukcod.org.uk>2010-05-12 12:57:26 +0100
committerMatthew Somerville <matthew@cake.ukcod.org.uk>2010-05-12 12:57:26 +0100
commite42a5835537f9afbc053da7bf24b48d9f9b0d67e (patch)
treeadc4074ff208d6c8647f594f2d520fcc7b21451d
parentbc9cbfa11ea4d5e9f587f2f8d90c691ecf037b62 (diff)
Some indices on the alert table.
-rw-r--r--db/schema.sql6
1 files changed, 5 insertions, 1 deletions
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),