This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ Improve DB performance by reducing amount of data that gets read in `device_lists_changes_in_room`.
Original file line number Diff line number Diff line change @@ -1441,6 +1441,13 @@ def __init__(
14411441 self ._remove_duplicate_outbound_pokes ,
14421442 )
14431443
1444+ self .db_pool .updates .register_background_index_update (
1445+ "device_lists_changes_in_room_by_room_index" ,
1446+ index_name = "device_lists_changes_in_room_by_room_idx" ,
1447+ table = "device_lists_changes_in_room" ,
1448+ columns = ["room_id" , "stream_id" ],
1449+ )
1450+
14441451 async def _drop_device_list_streams_non_unique_indexes (
14451452 self , progress : JsonDict , batch_size : int
14461453 ) -> int :
Original file line number Diff line number Diff line change 1+ /* Copyright 2022 The Matrix.org Foundation C.I.C
2+ *
3+ * Licensed under the Apache License, Version 2.0 (the "License");
4+ * you may not use this file except in compliance with the License.
5+ * You may obtain a copy of the License at
6+ *
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ *
9+ * Unless required by applicable law or agreed to in writing, software
10+ * distributed under the License is distributed on an "AS IS" BASIS,
11+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ * See the License for the specific language governing permissions and
13+ * limitations under the License.
14+ */
15+
16+
17+ -- Adds an index on `device_lists_changes_in_room (room_id, stream_id)`, which
18+ -- speeds up `/sync` queries.
19+ INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
20+ (7313 , ' device_lists_changes_in_room_by_room_index' , ' {}' );
You can’t perform that action at this time.
0 commit comments