From d4b647b4bf766bab3dfef580ac7425a3bfd886c7 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 22 Nov 2022 00:41:13 -0600 Subject: [PATCH] No need to order by stuff that isn't different See https://github.com/matrix-org/synapse/pull/14494#discussion_r1028925226 --- synapse/storage/databases/state/store.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/synapse/storage/databases/state/store.py b/synapse/storage/databases/state/store.py index d09419b218..356f79090c 100644 --- a/synapse/storage/databases/state/store.py +++ b/synapse/storage/databases/state/store.py @@ -335,8 +335,6 @@ class StateGroupDataStore(StateBackgroundUpdateStore, SQLBaseStore): ) AND (type = ? AND state_key = ?) ORDER BY - type, - state_key, -- Use the lastest state in the chain (highest numbered state_group in the chain) state_group DESC LIMIT 1