Add more data to the event_labels table and fix the indexes

This commit is contained in:
Brendan Abolivier 2019-11-01 11:47:28 +00:00
parent e3689ac6f7
commit a2c63c619a
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD
3 changed files with 21 additions and 5 deletions

View file

@ -874,7 +874,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
sql = (
"SELECT DISTINCT event_id, topological_ordering, stream_ordering"
" FROM events"
" LEFT JOIN event_labels USING (event_id)"
" LEFT JOIN event_labels USING (event_id, room_id, topological_ordering)"
" WHERE outlier = ? AND room_id = ? AND %(bounds)s"
" ORDER BY topological_ordering %(order)s,"
" stream_ordering %(order)s LIMIT ?"