Changes between Initial Version and Version 1 of Ticket #31535, comment 3
- Timestamp:
- May 4, 2020, 11:19:43 AM (5 years ago)
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 itcould 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.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 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.