Files
zulip/zerver/models/messages.py
Alex Vandiver ad21451d01 messages: Stop joining through every table.
Calling `.select_related()` with no arguments joins through every
possible table, recursively.  In this case, this currently produces a
query which joins through forty-three tables.

This is rather inefficient, particularly for what is a very common
call which should be very fast.

No callsite depends on having prefetched any joined table on the
object; drop all of the joins.

(cherry picked from commit 6ace34c374)
2024-03-28 12:31:46 -07:00

28 KiB