Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5792 from matrix-org/erikj/fix_bg_update
Browse files Browse the repository at this point in the history
Fix current_state_events membership background update.
  • Loading branch information
erikjohnston authored Jul 30, 2019
2 parents 7a48d0b + 958d69f commit 62a2d60
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/5792.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce database IO usage by optimising queries for current membership.
2 changes: 1 addition & 1 deletion synapse/storage/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ def _background_current_state_membership_txn(txn, last_processed_room):
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,),
)
Expand Down

0 comments on commit 62a2d60

Please sign in to comment.