Changes between Initial Version and Version 1 of Ticket #34639, comment 5


Ignore:
Timestamp:
Jun 7, 2023, 3:25:22 PM (11 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34639, comment 5

    initial v1  
    11It looks like this relates to #32682 (187118203197801c6cb72dc8b06b714b23b6dd3d).
    22
    3 The fact `self.root_queryset` is used without ''stripping'' unused annotations (e.g. the `Count` one) explains why the reporter is able to work around the issue by only annotating after the `Exists` filter is added.
     3The fact `self.root_queryset` is used without ''stripping'' unused annotations (e.g. the `Count` one) explains why the reporter is able to work around the issue by annotating their `Count` after the `Exists` filter is added which ensures it's not part of the subquery (which MySQL is bad at optimizing sometimes).
    44
    55Adjusting `SQLQuery.exists` to ''strip'' used annotation (like we did with `SQLQuery.get_aggreation` in #28477 (59bea9efd2768102fc9d3aedda469502c218e9b7)) could be a possible way to generically optimize this problem away.
Back to Top