#18785: Extra-Join Regression from ticket #15316 -------------------------------------+------------------------------------- Reporter: famousactress@… | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.4 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): I think you will need two thing here: - better pruning logic in trim_joins(). You will need to have better information about which joins are direct foreign keys and thus trimmable. - you will likely need to do similar improvement to Query.combine() as was done here: https://github.com/akaariai/django/blob/d301010fb92d6588d75fb3f9ecfe95ca6042cfed/django/db/models/sql/query.py#L480, that is, do not skip unused aliases, just unref them after addition. I think you should try to avoid changing existing return value of setup_joins() or adding new mandatory parameters to trim_joins(). Breaking these APIs in a minor release doesn't look nice, even if they are private APIs. Alternatively you might also want to check if you could solve #15316 in a way that doesn't introduce the regression. It seems that handling nonnull_check in the way it is done currently will simply not work. If you can test #10790 and see if it solves this regression for you, that would be very welcome. -- Ticket URL: <https://code.djangoproject.com/ticket/18785#comment:3> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.