Changes between Initial Version and Version 1 of Ticket #34728, comment 14
- Timestamp:
- Jul 27, 2023, 8:32:50 PM (17 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34728, comment 14
initial v1 5 5 > As you can see on the main branch of the repository linked above by the reporter, the query works as expected if it is rewritten to use Q objects 6 6 7 This happens to work because you perform the aggregation ''before'' filtering the multi-valued relationship which prevents JOIN reuse [https://docs.djangoproject.com/en/4.2/topics/db/aggregation/#order-of-annotate-and-filter-clauses as documented] and results in you joining twice against against the same multi-valued relationship 7 This happens to work because you perform the aggregation ''before'' filtering the multi-valued relationship which prevents JOIN reuse [https://docs.djangoproject.com/en/4.2/topics/db/aggregation/#order-of-annotate-and-filter-clauses as documented] and results in you joining twice against against the same multi-valued relationship as well as another one (tags) 8 8 9 9 {{{#!sql