summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-07 14:39:01 +0100
committerErik Johnston <erik@matrix.org>2016-09-07 14:39:01 +0100
commitfadb01551a897fdf1a2cbe43ff463c9616bd11ad (patch)
tree82778349690bc874479be8a662ddcf353e612ad7 /synapse/storage/state.py
parentUse windowing function to make use of index (diff)
downloadsynapse-fadb01551a897fdf1a2cbe43ff463c9616bd11ad.tar.xz
Add appopriate framing clause
Diffstat (limited to '')
-rw-r--r--synapse/storage/state.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 26ecad5907..382f308a60 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -324,6 +324,7 @@ class StateStore(SQLBaseStore):
                 )
                 SELECT type, state_key, last_value(event_id) OVER (
                     PARTITION BY type, state_key ORDER BY state_group ASC
+                    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
                 ) AS event_id FROM state_groups_state
                 WHERE state_group IN (
                     SELECT state_group FROM state