diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py
index 19eebbd43f..326a992abf 100644
--- a/synapse/handlers/room_list.py
+++ b/synapse/handlers/room_list.py
@@ -42,7 +42,7 @@ EMTPY_THIRD_PARTY_ID = ThirdPartyInstanceID(None, None)
class RoomListHandler(BaseHandler):
def __init__(self, hs):
super(RoomListHandler, self).__init__(hs)
- self.response_cache = ResponseCache(hs)
+ self.response_cache = ResponseCache(hs, timeout_ms=10 * 60 * 1000)
self.remote_response_cache = ResponseCache(hs, timeout_ms=30 * 1000)
def get_local_public_room_list(self, limit=None, since_token=None,
diff --git a/synapse/storage/event_push_actions.py b/synapse/storage/event_push_actions.py
index 7de3e8c58c..1874737674 100644
--- a/synapse/storage/event_push_actions.py
+++ b/synapse/storage/event_push_actions.py
@@ -101,11 +101,11 @@ class EventPushActionsStore(SQLBaseStore):
# notif=1
sql = (
"SELECT count(*)"
- " FROM event_push_actions ea"
+ " FROM (SELECT * FROM event_push_actions"
" WHERE"
" user_id = ?"
" AND room_id = ?"
- " AND %s"
+ " AND %s LIMIT 100) as ea"
) % (lower_bound(token, self.database_engine, inclusive=False),)
txn.execute(sql, (user_id, room_id))
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 04dbdac3f8..4f4d5440a8 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -591,7 +591,6 @@ class EventsStore(SQLBaseStore):
"event_edge_hashes",
"event_edges",
"event_forward_extremities",
- "event_push_actions",
"event_reference_hashes",
"event_search",
"event_signatures",
@@ -610,6 +609,13 @@ class EventsStore(SQLBaseStore):
"DELETE FROM %s WHERE event_id = ?" % (table,),
[(ev.event_id,) for ev, _ in events_and_contexts]
)
+ for table in (
+ "event_push_actions",
+ ):
+ txn.executemany(
+ "DELETE FROM %s WHERE room_id = ? AND event_id = ?" % (table,),
+ [(ev.event_id,) for ev, _ in events_and_contexts]
+ )
self._simple_insert_many_txn(
txn,
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 8f2b3c4435..17c6c55714 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -600,7 +600,7 @@ def _parse_query(database_engine, search_term):
results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)
if isinstance(database_engine, PostgresEngine):
- return " & ".join(result + ":*" for result in results)
+ return " & ".join(result for result in results)
elif isinstance(database_engine, Sqlite3Engine):
return " & ".join(result + "*" for result in results)
else:
|