Join both tables with stream_ordering

This commit is contained in:
Eric Eastwood 2024-06-26 01:16:46 -05:00
parent 62c6a4e860
commit 39259f66fa

View file

@ -831,7 +831,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
e.sender
FROM current_state_delta_stream AS s
INNER JOIN events AS e ON e.stream_ordering = s.stream_id
INNER JOIN room_memberships AS m ON m.event_id = e.event_id
INNER JOIN room_memberships AS m ON m.event_stream_ordering = s.stream_id
WHERE m.user_id = ?
AND s.stream_id > ? AND s.stream_id <= ?
ORDER BY s.stream_id ASC