1
0

Compare commits

...

3 Commits

Author SHA1 Message Date
Eric Eastwood 6c3d303880 Add changelog 2023-06-06 22:16:42 -05:00
Eric Eastwood 003267bfcd Remove extra current_state_events join 2023-06-06 22:13:49 -05:00
Eric Eastwood d79caed493 Clean-up query formatting 2023-06-06 22:12:49 -05:00
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
Simplify query to `_count_known_servers()` for the `synapse_federation_known_servers` metric.
+4 -4
View File
@@ -131,10 +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
INNER JOIN current_state_events as c ON rm.event_id = c.event_id
WHERE c.type = 'm.room.member'
SELECT
user_id AS user_id,
instr(user_id, ':') AS pos
FROM room_memberships
) as out
"""
else: