summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-10-27 11:56:36 +0100
committerErik Johnston <erik@matrix.org>2021-10-27 11:56:36 +0100
commit2bb023ba2b4fa607effbbe247791551263081b72 (patch)
tree2b3d76fac0637cf5712359e5b029bd2adae68cf6
parentMerge branch 'release-v1.46' of github.com:matrix-org/synapse into matrix-org... (diff)
downloadsynapse-2bb023ba2b4fa607effbbe247791551263081b72.tar.xz
Don't seqscan event_json due to relates_to_id
-rw-r--r--synapse/storage/databases/main/events_bg_updates.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/events_bg_updates.py b/synapse/storage/databases/main/events_bg_updates.py
index f92d824876..ae3a8a63e4 100644
--- a/synapse/storage/databases/main/events_bg_updates.py
+++ b/synapse/storage/databases/main/events_bg_updates.py
@@ -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),