summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2023-06-06 22:12:49 -0500
committerEric Eastwood <contact@ericeastwood.com>2023-06-06 22:12:49 -0500
commitd79caed49336a33cb033ce8b8af22a2e75ef94ee (patch)
tree5ad6137a86794b16cfc0312a7b3fcbded1852fba
parentImprove performance of user directory search (#15729) (diff)
downloadsynapse-d79caed49336a33cb033ce8b8af22a2e75ef94ee.tar.xz
Clean-up query formatting
-rw-r--r--synapse/storage/databases/main/roommember.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py
index ae9c201b87..eddf5ed924 100644
--- a/synapse/storage/databases/main/roommember.py
+++ b/synapse/storage/databases/main/roommember.py
@@ -131,8 +131,10 @@ class RoomMemberWorkerStore(EventsWorkerStore, CacheInvalidationWorkerStore):
                 query = """
                     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
+                        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'
                     ) as out