mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Add state_groups.room_id index
This commit is contained in:
parent
f91f2a1f92
commit
61be1a2926
@ -0,0 +1,17 @@
|
||||
/* Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
INSERT INTO background_updates (update_name, progress_json) VALUES
|
||||
('state_groups_room_id_idx', '{}');
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user