diff options
author | Erik Johnston <erik@matrix.org> | 2024-06-26 13:14:48 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2024-06-26 13:14:48 +0100 |
commit | 90e1df262d6d1a8f55595345c73aa5352109dff5 (patch) | |
tree | 58217ada46f0bf07be2ef81f16cb68952e7d9507 | |
parent | Remove debug logging (diff) | |
download | synapse-github/erikj/chains_debug_logging.tar.xz |
Handle SQLite github/erikj/chains_debug_logging erikj/chains_debug_logging
-rw-r--r-- | synapse/storage/databases/main/event_federation.py | 7 |
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 ( |