浏览代码

Remove extra `current_state_events` join

Eric Eastwood 11 月之前
父节点
当前提交
003267bfcd
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      synapse/storage/databases/main/roommember.py

+ 3 - 5
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: