Skip to content
Snippets Groups Projects
Commit b7704353 authored by Erik Johnston's avatar Erik Johnston
Browse files

Make get_new_events_for_appservice use indices

parent 5674ea3e
No related branches found
No related tags found
No related merge requests found
...@@ -366,8 +366,11 @@ class ApplicationServiceTransactionStore(SQLBaseStore): ...@@ -366,8 +366,11 @@ class ApplicationServiceTransactionStore(SQLBaseStore):
def get_new_events_for_appservice_txn(txn): def get_new_events_for_appservice_txn(txn):
sql = ( sql = (
"SELECT e.stream_ordering, e.event_id" "SELECT e.stream_ordering, e.event_id"
" FROM events AS e, appservice_stream_position AS a" " FROM events AS e"
" WHERE a.stream_ordering < e.stream_ordering AND e.stream_ordering <= ?" " WHERE"
" (SELECT stream_ordering FROM appservice_stream_position)"
" < e.stream_ordering"
" AND e.stream_ordering <= ?"
" ORDER BY e.stream_ordering ASC" " ORDER BY e.stream_ordering ASC"
" LIMIT ?" " LIMIT ?"
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment