mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
message: Move join to recipients outside of LIMIT, via CTE.
This commit is contained in:
committed by
Tim Abbott
parent
5f0a55544b
commit
70ed1ee46c
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from django.db import models, transaction
|
||||
from django.db.models import QuerySet
|
||||
from django_cte import CTEManager
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.lib.display_recipient import get_display_recipient
|
||||
@@ -52,6 +53,8 @@ class Recipient(models.Model):
|
||||
# The type group direct messages.
|
||||
DIRECT_MESSAGE_GROUP = 3
|
||||
|
||||
objects = CTEManager() # type: ignore[django-manager-missing] # django-stubs cannot resolve the custom CTEManager yet https://github.com/typeddjango/django-stubs/issues/1023
|
||||
|
||||
class Meta:
|
||||
unique_together = ("type", "type_id")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user