From 5300d657cc881a1e8dba59498c90098930029d68 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 17 Dec 2010 16:22:26 -0800 Subject: [PATCH] Sort indexing fix for profile sidebar: add group_member_profile_id_created_idx to group_member table, streamlines sorting of your group memberships in the sidebar --- db/096to097.sql | 3 +++ db/statusnet.sql | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/db/096to097.sql b/db/096to097.sql index 875077e8b8..209a3a8811 100644 --- a/db/096to097.sql +++ b/db/096to097.sql @@ -21,3 +21,6 @@ alter table group_inbox add index group_inbox_group_id_created_notice_id_idx (gr -- Helps make some reverse role lookups more efficient if there's a lot of assigned accounts alter table profile_role add index profile_role_role_created_profile_id_idx (role, created, profile_id); + +-- Fix for sorting a user's group memberships by order joined +alter table group_member add index group_member_profile_id_created_idx (profile_id, created); diff --git a/db/statusnet.sql b/db/statusnet.sql index 0c1697a7e9..4a24d016a2 100644 --- a/db/statusnet.sql +++ b/db/statusnet.sql @@ -463,7 +463,10 @@ create table group_member ( constraint primary key (group_id, profile_id), index group_member_profile_id_idx (profile_id), - index group_member_created_idx (created) + index group_member_created_idx (created), + + -- To pull up a list of someone's groups in order joined + index group_member_profile_id_created_idx (profile_id, created) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; -- 2.39.5