mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Make get_new_events_for_appservice use indices
This commit is contained in:
parent
5674ea3e6c
commit
b770435389
@ -366,8 +366,11 @@ class ApplicationServiceTransactionStore(SQLBaseStore):
|
||||
def get_new_events_for_appservice_txn(txn):
|
||||
sql = (
|
||||
"SELECT e.stream_ordering, e.event_id"
|
||||
" FROM events AS e, appservice_stream_position AS a"
|
||||
" WHERE a.stream_ordering < e.stream_ordering AND e.stream_ordering <= ?"
|
||||
" FROM events AS e"
|
||||
" WHERE"
|
||||
" (SELECT stream_ordering FROM appservice_stream_position)"
|
||||
" < e.stream_ordering"
|
||||
" AND e.stream_ordering <= ?"
|
||||
" ORDER BY e.stream_ordering ASC"
|
||||
" LIMIT ?"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user