summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-08 09:55:16 +0100
committerGitHub <noreply@github.com>2016-09-08 09:55:16 +0100
commit2982d16e07ec0aed6b7b788e2860a18408b13da0 (patch)
treed1f8ed94fbd7b7600d2a88e10315ccd4bb5f6f96 /synapse
parentMerge pull request #1077 from matrix-org/markjh/device_logging (diff)
parentTemporarily disable sequential scans for state fetching (diff)
downloadsynapse-2982d16e07ec0aed6b7b788e2860a18408b13da0.tar.xz
Merge pull request #1079 from matrix-org/erikj/state_seqscan
Temporarily disable sequential scans for state fetching
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/state.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index d6643473db..fef87834ca 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -310,6 +310,10 @@ class StateStore(SQLBaseStore):
 
         results = {group: {} for group in groups}
         if isinstance(self.database_engine, PostgresEngine):
+            # Temporarily disable sequential scans in this transaction. This is
+            # a temporary hack until we can add the right indices in
+            txn.execute("SET LOCAL enable_seqscan=off")
+
             # The below query walks the state_group tree so that the "state"
             # table includes all state_groups in the tree. It then joins
             # against `state_groups_state` to fetch the latest state.