mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 07:52:56 +01:00
Merge pull request #1029 from matrix-org/erikj/appservice_stream
Make get_new_events_for_appservice use indices
This commit is contained in:
commit
290763f559
1 changed files with 5 additions and 2 deletions
|
@ -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 ?"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue