Add state_groups.room_id index

This commit is contained in:
Erik Johnston 2019-10-31 15:39:26 +00:00
parent f91f2a1f92
commit 61be1a2926
2 changed files with 24 additions and 0 deletions

View file

@ -1021,6 +1021,7 @@ class StateBackgroundUpdateStore(
STATE_GROUP_INDEX_UPDATE_NAME = "state_group_state_type_index"
CURRENT_STATE_INDEX_UPDATE_NAME = "current_state_members_idx"
EVENT_STATE_GROUP_INDEX_UPDATE_NAME = "event_to_state_groups_sg_index"
STATE_GROUPS_ROOM_INDEX_UPDATE_NAME = "state_groups_room_id_idx"
def __init__(self, db_conn, hs):
super(StateBackgroundUpdateStore, self).__init__(db_conn, hs)
@ -1044,6 +1045,12 @@ class StateBackgroundUpdateStore(
table="event_to_state_groups",
columns=["state_group"],
)
self.register_background_index_update(
self.STATE_GROUPS_ROOM_INDEX_UPDATE_NAME,
index_name="state_groups_room_id_idx",
table="state_groups",
columns=["room_id"],
)
@defer.inlineCallbacks
def _background_deduplicate_state(self, progress, batch_size):