summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-01-06 13:33:40 +0000
committerMark Haines <mjark@negativecurvature.net>2015-01-06 13:33:40 +0000
commit5e23a192040cefcade3048db33fae09accf61a6a (patch)
tree0a38b94e77dd8bfbaba650b5fa9c943c230a4e37 /synapse/storage/state.py
parentUpdate copyright notices (diff)
parentPEP8 (diff)
downloadsynapse-5e23a192040cefcade3048db33fae09accf61a6a.tar.xz
Merge pull request #28 from matrix-org/erikj-perf
Database performance improvements.
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r--synapse/storage/state.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 6c7fd66933..5327517704 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -15,6 +15,10 @@
 
 from ._base import SQLBaseStore
 
+import logging
+
+logger = logging.getLogger(__name__)
+
 
 class StateStore(SQLBaseStore):
     """ Keeps track of the state at a given event.
@@ -62,14 +66,8 @@ class StateStore(SQLBaseStore):
                     keyvalues={"state_group": group},
                     retcol="event_id",
                 )
-                state = []
-                for state_id in state_ids:
-                    s = self._get_events_txn(
-                        txn,
-                        [state_id],
-                    )
-                    if s:
-                        state.extend(s)
+
+                state = self._get_events_txn(txn, state_ids)
 
                 res[group] = state