Merge pull request #5792 from matrix-org/erikj/fix_bg_update

Fix current_state_events membership background update.
This commit is contained in:
Erik Johnston 2019-07-30 15:20:09 +01:00 committed by GitHub
commit 62a2d60d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 1 deletions

1
changelog.d/5792.misc Normal file
View File

@ -0,0 +1 @@
Reduce database IO usage by optimising queries for current membership.

View File

@ -935,7 +935,7 @@ class RoomMemberStore(RoomMemberWorkerStore):
while processed < batch_size:
txn.execute(
"""
SELECT MIN(room_id) FROM rooms WHERE room_id > ?
SELECT MIN(room_id) FROM current_state_events WHERE room_id > ?
""",
(last_processed_room,),
)