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

Remove superfluous room_memberships join from background update #15733

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15733.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove superfluous `room_memberships` join from background update.
1 change: 0 additions & 1 deletion synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,6 @@ def add_membership_profile_txn(txn: LoggingTransaction) -> int:
SELECT stream_ordering, event_id, events.room_id, event_json.json
FROM events
INNER JOIN event_json USING (event_id)
INNER JOIN room_memberships USING (event_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any columns used from this table in the query

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does make sure we only look at membership events but we also use type = 'm.room.member' below which does the same thing.

WHERE ? <= stream_ordering AND stream_ordering < ?
AND type = 'm.room.member'
ORDER BY stream_ordering DESC
Expand Down