oops, tweak work_mem when actually storing

This commit is contained in:
Matthew Hodgson 2018-01-09 16:30:30 +00:00
parent 19f9227643
commit e365ad329f
1 changed files with 2 additions and 0 deletions

View File

@ -310,6 +310,7 @@ class RoomStore(SQLBaseStore):
def _store_event_search_txn(self, txn, event, key, value):
if isinstance(self.database_engine, PostgresEngine):
txn.execute("SET work_mem='256KB'")
sql = (
"INSERT INTO event_search"
" (event_id, room_id, key, vector, stream_ordering, origin_server_ts)"
@ -323,6 +324,7 @@ class RoomStore(SQLBaseStore):
event.origin_server_ts,
)
)
txn.execute("RESET work_mem")
elif isinstance(self.database_engine, Sqlite3Engine):
sql = (
"INSERT INTO event_search (event_id, room_id, key, value)"