mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Add an index to make membership queries faster
This commit is contained in:
parent
ac001dabdc
commit
21b7375778
3 changed files with 26 additions and 1 deletions
|
@ -49,6 +49,7 @@ class StateStore(SQLBaseStore):
|
|||
|
||||
STATE_GROUP_DEDUPLICATION_UPDATE_NAME = "state_group_state_deduplication"
|
||||
STATE_GROUP_INDEX_UPDATE_NAME = "state_group_state_type_index"
|
||||
CURRENT_STATE_INDEX_UPDATE_NAME = "current_state_members_idx"
|
||||
|
||||
def __init__(self, hs):
|
||||
super(StateStore, self).__init__(hs)
|
||||
|
@ -60,6 +61,13 @@ class StateStore(SQLBaseStore):
|
|||
self.STATE_GROUP_INDEX_UPDATE_NAME,
|
||||
self._background_index_state,
|
||||
)
|
||||
self.register_background_index_update(
|
||||
self.CURRENT_STATE_INDEX_UPDATE_NAME,
|
||||
index_name="current_state_events_member_index",
|
||||
table="current_state_events",
|
||||
columns=["state_key"],
|
||||
where_clause="type='m.room.member'",
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def get_state_groups_ids(self, room_id, event_ids):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue