Don't seqscan event_json due to relates_to_id
This commit is contained in:
parent
d8c1a21492
commit
2bb023ba2b
|
@ -1108,7 +1108,7 @@ class EventsBackgroundUpdatesStore(SQLBaseStore):
|
|||
"""
|
||||
SELECT event_id, json FROM event_json
|
||||
LEFT JOIN event_relations USING (event_id)
|
||||
WHERE event_id > ? AND relates_to_id IS NULL
|
||||
WHERE event_id > ? AND event_relations.event_id IS NULL
|
||||
ORDER BY event_id LIMIT ?
|
||||
""",
|
||||
(last_event_id, batch_size),
|
||||
|
|
Loading…
Reference in a new issue