summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-06-26 13:14:48 +0100
committerErik Johnston <erik@matrix.org>2024-06-26 13:14:48 +0100
commit90e1df262d6d1a8f55595345c73aa5352109dff5 (patch)
tree58217ada46f0bf07be2ef81f16cb68952e7d9507
parentRemove debug logging (diff)
downloadsynapse-erikj/chains_debug_logging.tar.xz
-rw-r--r--synapse/storage/databases/main/event_federation.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py
index c3bdfe1e5a..9b3ced9edb 100644
--- a/synapse/storage/databases/main/event_federation.py
+++ b/synapse/storage/databases/main/event_federation.py
@@ -406,8 +406,11 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
         # also returning large quantities of redundant data (which can make it a
         # lot slower).
 
-        txn.execute("SET LOCAL jit = off")
-        txn.execute("SET LOCAL enable_seqscan = off")
+        if isinstance(txn.database_engine, PostgresEngine):
+            # JIT and sequential scans sometimes get hit on this code path, which
+            # can make the queries much more expensive
+            txn.execute("SET LOCAL jit = off")
+            txn.execute("SET LOCAL enable_seqscan = off")
 
         sql = """
             WITH RECURSIVE links(chain_id) AS (