Changes between Initial Version and Version 1 of Ticket #31535, comment 3


Ignore:
Timestamp:
May 4, 2020, 11:19:43 AM (5 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31535, comment 3

    initial v1  
    1 The ORM is able to optimize `.filter(unlocked_by__in=solved_challenges)` into an `INNER JOIN` but it cannot do the same for annotations because it could be doing some special handling of `NULL` and it would require some pretty sophisticated introspection to determine it's safe to do. It would also be backward incompatible at this point. You should rely on `Subquery` or even `Exists` in your reported case instead.
     1The ORM is able to optimize `.filter(unlocked_by__in=solved_challenges)` into an `INNER JOIN` but it cannot do the same for annotations because the could be doing some special handling of `NULL` and it would require some pretty sophisticated introspection to determine it's safe to do. It would also be backward incompatible at this point. You should rely on `Subquery` or even `Exists` in your reported case instead.
Back to Top