summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-30 18:49:26 +0100
committerErik Johnston <erik@matrix.org>2015-04-30 18:49:26 +0100
commit8be5284e918be6ffc0fc8e1260a0a574d8a3f0ac (patch)
tree9872a9e235287914ec7646c91874795e9d5ffa9b /synapse/storage
parentFix broken SQL (diff)
downloadsynapse-8be5284e918be6ffc0fc8e1260a0a574d8a3f0ac.tar.xz
Remove pointless join
Diffstat (limited to '')
-rw-r--r--synapse/storage/state.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 32d4ff84d4..7e55e8bed6 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -130,16 +130,15 @@ class StateStore(SQLBaseStore):
     def get_current_state(self, room_id, event_type=None, state_key=""):
         def f(txn):
             sql = (
-                "SELECT e.event_id FROM events as e"
-                " INNER JOIN current_state_events as c ON e.event_id = c.event_id"
-                " WHERE c.room_id = ? "
+                "SELECT event_id FROM current_state_events"
+                " WHERE room_id = ? "
             )
 
             if event_type and state_key is not None:
-                sql += " AND c.type = ? AND c.state_key = ? "
+                sql += " AND type = ? AND state_key = ? "
                 args = (room_id, event_type, state_key)
             elif event_type:
-                sql += " AND c.type = ?"
+                sql += " AND type = ?"
                 args = (room_id, event_type)
             else:
                 args = (room_id, )