summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-07 14:53:19 +0100
committerErik Johnston <erik@matrix.org>2016-09-07 14:53:23 +0100
commit513188aa56bc680a54dbdf6d40657da72c5c6877 (patch)
treefa0c318f37f43ddfb4e115cf0475e373da584da6
parentAdd appopriate framing clause (diff)
downloadsynapse-513188aa56bc680a54dbdf6d40657da72c5c6877.tar.xz
Comment
-rw-r--r--synapse/storage/state.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 382f308a60..d6643473db 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -315,6 +315,10 @@ class StateStore(SQLBaseStore):
             # against `state_groups_state` to fetch the latest state.
             # It assumes that previous state groups are always numerically
             # lesser.
+            # The PARTITION is used to get the event_id in the greatest state
+            # group for the given type, state_key.
+            # This may return multiple rows per (type, state_key), but last_value
+            # should be the same.
             sql = ("""
                 WITH RECURSIVE state(state_group) AS (
                     VALUES(?::bigint)