summaryrefslogtreecommitdiff
path: root/db/08to09.sql
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-11-10 08:23:24 -0800
committerBrion Vibber <brion@pobox.com>2009-11-10 08:23:24 -0800
commit9d0687b0559095f270a55af3467c53ad29bfd4c7 (patch)
treea64ad03aa33ee8c6973026dbc880c6006a84ef6e /db/08to09.sql
parent486dbe6aef380a9057c5ac609cd1c6086a5e34fc (diff)
Adjusting indexes to make favorites query more efficient, based on feedback from ops.
fave_user_id_idx index changed from (user_id) to (user_id,modified), so the timestamp ordering can be done straight from the index while we're looking up the user's notices. Added to 08to09.sql and 08to09_pg.sql; may need to be run manually by folks doing development. (No harm if you don't update it, the favorites tab/rss feed will just stay inefficent.)
Diffstat (limited to 'db/08to09.sql')
-rw-r--r--db/08to09.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/db/08to09.sql b/db/08to09.sql
index a0e37f0f1..e6842225b 100644
--- a/db/08to09.sql
+++ b/db/08to09.sql
@@ -42,3 +42,6 @@ create table login_token (
constraint primary key (user_id)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+alter table fave
+ drop index fave_user_id_idx,
+ add index fave_user_id_idx (user_id,modified);