Changes between Version 4 and Version 5 of Ticket #33973, comment 2


Ignore:
Timestamp:
Sep 1, 2022, 3:29:06 PM (2 years ago)
Author:
Marc Parizeau

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33973, comment 2

    v4 v5  
    33{{{
    44Content.objects.all().annotate(
    5         unread=Greatest(
    6             Exists(
    7                 # a thread has no user entry (0.03s on 3.1.14 vs 0.30s on 3.2.15)
    8                 Thread.objects.filter(
    9                     content=OuterRef('pk'),
    10                 ).exclude(threadentry__user=user)
    11             ),
    12             False,
    13         )
     5    unread=Exists(
     6            Thread.objects.filter(
     7                content=OuterRef('pk'),
     8            ).exclude(threadentry__user=user)
    149    ).filter(
    1510        unread=True,
Back to Top