Add more conditions on JOINs to make postgres go a little faster.

This commit is contained in:
Erik Johnston 2015-04-30 18:32:03 +01:00
parent f383d5a801
commit 6ead27ddda
2 changed files with 6 additions and 4 deletions

View file

@ -212,7 +212,7 @@ class RoomMemberStore(SQLBaseStore):
sql = (
"SELECT m.* FROM room_memberships as m"
" INNER JOIN current_state_events as c"
" ON m.event_id = c.event_id"
" ON m.event_id = c.event_id AND m.room_id = c.room_id "
" WHERE %(where)s"
) % {
"where": where_clause,