diff options
author | Brion Vibber <brion@pobox.com> | 2009-11-10 08:47:54 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-11-10 08:47:54 -0800 |
commit | 737fe763471bcb6ebd95c318363308a33e28e889 (patch) | |
tree | b9094b0adda4e666fa9480f547a80b0a54e027b5 /db/statusnet.sql | |
parent | 9d0687b0559095f270a55af3467c53ad29bfd4c7 (diff) |
Performance fix for subscription/subscriber lists based on feedback from ops.
Extended subscription table indexes for subscriber and subscribed to include the created field, which is used to sort for display. This lets us skip a filesort and do the join much more efficiently.
Alter table from 08to09.sql needs to be run manually (though no ill effects if you forget other than not getting the perf improvement).
Diffstat (limited to 'db/statusnet.sql')
-rw-r--r-- | db/statusnet.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/statusnet.sql b/db/statusnet.sql index 510c8866e..2983c67cf 100644 --- a/db/statusnet.sql +++ b/db/statusnet.sql @@ -107,8 +107,8 @@ create table subscription ( modified timestamp comment 'date this record was modified', constraint primary key (subscriber, subscribed), - index subscription_subscriber_idx (subscriber), - index subscription_subscribed_idx (subscribed), + index subscription_subscriber_idx (subscriber, created), + index subscription_subscribed_idx (subscribed, created), index subscription_token_idx (token) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; |