narrow: Remove get_base_query_for_search need_message optimization.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-03-04 16:46:18 -08:00
committed by Tim Abbott
parent 7e75166b5f
commit dc22b5d4bf
3 changed files with 57 additions and 46 deletions

View File

@@ -349,7 +349,7 @@ def messages_in_narrow_backend(
# This query is limited to messages the user has access to because they
# actually received them, as reflected in `zerver_usermessage`.
query, inner_msg_id_col = get_base_query_for_search(
user_profile.realm_id, user_profile, need_message=True, need_user_message=True
user_profile.realm_id, user_profile, need_user_message=True
)
query = query.where(column("message_id", Integer).in_(msg_ids))