summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-29 15:39:17 +0000
committerErik Johnston <erik@matrix.org>2016-01-29 15:39:17 +0000
commit8da95b6f1bb1a37597f0b89c4da88b064401b0b8 (patch)
tree142777a1c54d6633dcd4f487981c07f821a75156 /synapse/storage/__init__.py
parentDon't prefill account data (diff)
downloadsynapse-8da95b6f1bb1a37597f0b89c4da88b064401b0b8.tar.xz
Comment. Remove superfluous order by
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index a6cb588563..ee2153737d 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -139,11 +139,13 @@ class DataStore(RoomMemberStore, RoomStore,
         super(DataStore, self).__init__(hs)
 
     def _get_cache_dict(self, db_conn, table, entity_column, stream_column, max_value):
+        # Fetch a mapping of room_id -> max stream position for "recent" rooms.
+        # It doesn't really matter how many we get, the StreamChangeCache will
+        # do the right thing to ensure it respects the max size of cache.
         sql = (
             "SELECT %(entity)s, MAX(%(stream)s) FROM %(table)s"
             " WHERE %(stream)s > ? - 100000"
             " GROUP BY %(entity)s"
-            " ORDER BY MAX(%(stream)s) DESC"
         ) % {
             "table": table,
             "entity": entity_column,