Make deleting push actions more efficient

There's no index on received_ts, so manually binary search using the stream_ordering index, and only update it once an hour.
This commit is contained in:
David Baker 2016-05-20 17:56:10 +01:00
parent 149fa411e2
commit d4503e25ed
3 changed files with 68 additions and 13 deletions

View file

@ -88,6 +88,7 @@ class DataStore(RoomMemberStore, RoomStore,
def __init__(self, db_conn, hs):
self.hs = hs
self._clock = hs.get_clock()
self.database_engine = hs.database_engine
self.client_ip_last_seen = Cache(
@ -173,6 +174,14 @@ class DataStore(RoomMemberStore, RoomStore,
prefilled_cache=push_rules_prefill,
)
cur = db_conn.cursor()
self._find_stream_orderings_for_times_txn(cur)
cur.close()
self.find_stream_orderings_looping_call = self._clock.looping_call(
self._find_stream_orderings_for_times, 60 * 60 * 1000
)
super(DataStore, self).__init__(hs)
def take_presence_startup_info(self):