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_pg.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_pg.sql')
-rw-r--r-- | db/statusnet_pg.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql index 710883e57..392a6a5f3 100644 --- a/db/statusnet_pg.sql +++ b/db/statusnet_pg.sql @@ -115,8 +115,8 @@ create table subscription ( primary key (subscriber, subscribed) ); -create index subscription_subscriber_idx on subscription using btree(subscriber); -create index subscription_subscribed_idx on subscription using btree(subscribed); +create index subscription_subscriber_idx on subscription using btree(subscriber,created); +create index subscription_subscribed_idx on subscription using btree(subscribed,created); create sequence notice_seq; create table notice ( |