diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2023-06-06 22:13:49 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2023-06-06 22:13:49 -0500 |
commit | 003267bfcdf97a6b91351bf003d5cea3fd8c3831 (patch) | |
tree | 435ff56e668bc3ab30c2f71a51c62fab882f0e31 | |
parent | Clean-up query formatting (diff) | |
download | synapse-003267bfcdf97a6b91351bf003d5cea3fd8c3831.tar.xz |
Remove extra `current_state_events` join
-rw-r--r-- | synapse/storage/databases/main/roommember.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py index eddf5ed924..e6782980bf 100644 --- a/synapse/storage/databases/main/roommember.py +++ b/synapse/storage/databases/main/roommember.py @@ -132,11 +132,9 @@ class RoomMemberWorkerStore(EventsWorkerStore, CacheInvalidationWorkerStore): SELECT COUNT(DISTINCT substr(out.user_id, pos+1)) FROM ( SELECT - rm.user_id AS user_id, - instr(rm.user_id, ':') AS pos - FROM room_memberships as rm - INNER JOIN current_state_events as c ON rm.event_id = c.event_id - WHERE c.type = 'm.room.member' + user_id AS user_id, + instr(user_id, ':') AS pos + FROM room_memberships ) as out """ else: |