mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix thread BG update to not seq scan event_json (#11192)
For some reason the query optimiser decided to seq scan both tables, rather than index scanning `event_json`.
This commit is contained in:
parent
2dbef6c10a
commit
72626b78ef
1
changelog.d/11192.feature
Normal file
1
changelog.d/11192.feature
Normal file
@ -0,0 +1 @@
|
|||||||
|
Experimental support for the thread relation defined in [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440).
|
@ -1108,7 +1108,7 @@ class EventsBackgroundUpdatesStore(SQLBaseStore):
|
|||||||
"""
|
"""
|
||||||
SELECT event_id, json FROM event_json
|
SELECT event_id, json FROM event_json
|
||||||
LEFT JOIN event_relations USING (event_id)
|
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 ?
|
ORDER BY event_id LIMIT ?
|
||||||
""",
|
""",
|
||||||
(last_event_id, batch_size),
|
(last_event_id, batch_size),
|
||||||
|
Loading…
Reference in New Issue
Block a user