From e529ceee21b4fb0c18f32f7a097bce14229af42f Mon Sep 17 00:00:00 2001
From: Brion Vibber <brion@pobox.com>
Date: Mon, 1 Mar 2010 12:20:04 -0800
Subject: Add index on post_id for file_to_post, needed for efficient lookups
 of files/urls attached to a given post.

---
 db/08to09.sql | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'db/08to09.sql')

diff --git a/db/08to09.sql b/db/08to09.sql
index b10e47dbc..582981614 100644
--- a/db/08to09.sql
+++ b/db/08to09.sql
@@ -110,3 +110,5 @@ insert into queue_item_new (frame,transport,created,claimed)
 alter table queue_item rename to queue_item_old;
 alter table queue_item_new rename to queue_item;
 
+alter table file_to_post
+    add index post_id_idx (post_id);
-- 
cgit v1.2.3-54-g00ecf


From 946445eea945b28d50f7409815a4913f50061958 Mon Sep 17 00:00:00 2001
From: Brion Vibber <brion@pobox.com>
Date: Mon, 1 Mar 2010 13:09:20 -0800
Subject: Add index on group_index.notice_id, needed to pull list of target
 groups for inbox delivery. Index was present on live identi.ca database but
 missing from master definitions: group_inbox_notice_id_idx

---
 db/08to09.sql    | 3 +++
 db/statusnet.sql | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

(limited to 'db/08to09.sql')

diff --git a/db/08to09.sql b/db/08to09.sql
index 582981614..f30572154 100644
--- a/db/08to09.sql
+++ b/db/08to09.sql
@@ -112,3 +112,6 @@ alter table queue_item_new rename to queue_item;
 
 alter table file_to_post
     add index post_id_idx (post_id);
+
+alter table group_inbox
+    add index group_inbox_notice_id_idx (notice_id);
diff --git a/db/statusnet.sql b/db/statusnet.sql
index 4aa37ce1c..3f95948e1 100644
--- a/db/statusnet.sql
+++ b/db/statusnet.sql
@@ -458,7 +458,8 @@ create table group_inbox (
     created datetime not null comment 'date the notice was created',
 
     constraint primary key (group_id, notice_id),
-    index group_inbox_created_idx (created)
+    index group_inbox_created_idx (created),
+    index group_inbox_notice_id_idx (notice_id)
 
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
-- 
cgit v1.2.3-54-g00ecf

