diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2023-06-06 22:12:49 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2023-06-06 22:12:49 -0500 |
commit | d79caed49336a33cb033ce8b8af22a2e75ef94ee (patch) | |
tree | 5ad6137a86794b16cfc0312a7b3fcbded1852fba | |
parent | Improve performance of user directory search (#15729) (diff) | |
download | synapse-d79caed49336a33cb033ce8b8af22a2e75ef94ee.tar.xz |
Clean-up query formatting
-rw-r--r-- | synapse/storage/databases/main/roommember.py | 6 |
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 |