From cf5a00d94bca39837139b8bebd42c9c36f17ce6d Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 19 Sep 2019 16:15:00 -0700 Subject: [PATCH] bulk_get_subscriber_user_ids: Sort each user list by ID. This simple backwards-compatible change saves approximately 12% in the compressed size of the chat.zulip.org page_params. We can do much, much better by changing the format, but this seems like a good intermediate step. Signed-off-by: Anders Kaseorg --- zerver/lib/actions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index c0da4f3cf2..7ab987642f 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2627,7 +2627,8 @@ def bulk_get_subscriber_user_ids(stream_dicts: Iterable[Mapping[str, Any]], zerver_subscription.active AND zerver_userprofile.is_active ORDER BY - zerver_subscription.recipient_id + zerver_subscription.recipient_id, + zerver_subscription.user_profile_id ''' % (id_list,) cursor = connection.cursor()