-- 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);
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;