summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-05-16 11:13:31 +0100
committerErik Johnston <erik@matrix.org>2018-05-16 11:13:31 +0100
commit43e6e82c4d368d981f8a0015246d19c333511ace (patch)
tree9d36d34163d0c7c1fc6e56b77a450e29ef126798 /synapse
parentMove and rename variable (diff)
downloadsynapse-43e6e82c4d368d981f8a0015246d19c333511ace.tar.xz
Comments
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/events.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 22699cb689..93ac80ee48 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -1872,6 +1872,9 @@ class EventsStore(EventsWorkerStore):
             "CREATE INDEX events_to_purge_should_delete"
             " ON events_to_purge(should_delete)",
         )
+
+        # We do joins against events_to_purge for e.g. calculating state
+        # groups to purge, etc., so lets make an index.
         txn.execute(
             "CREATE INDEX events_to_purge_id"
             " ON events_to_purge(event_id)",
@@ -2119,6 +2122,11 @@ class EventsStore(EventsWorkerStore):
         #
         # So, let's stick it at the end so that we don't block event
         # persistence.
+        #
+        # We do this by calculating the minimum depth of the backwards
+        # extremities. However, the events in event_backward_extremities
+        # are ones we don't have yet so we need to look at the events that
+        # point to it via event_edges table.
         txn.execute("""
             SELECT COALESCE(MIN(depth), 0)
             FROM event_backward_extremities AS eb