#10790: Too many joins in a comparison for NULL. -------------------------------------+------------------------------------- Reporter: mtredinnick | Owner: Type: Bug | mtredinnick Component: Database layer | Status: new (models, ORM) | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by famousactress@…): Yeah, I'm almost done cleaning up the unit tests and commenting each of them, because I think they provide a pretty thorough set of cases that will be helpful with whatever solution we eventually arrive at. I'm also rewording the comment language in the tests to not talk about which joins should be trimmed, etc.. but rather just what we're testing and how the queries are expected to work. I'm also seeing at least one inconsistency with the way queries are produced that I don't think was introduced by this patch (will confirm), so I'll probably end up spinning out a separate ticket for that bit after confirming on the mailing list it's not intended behavior. As for the patch itself, my limited understanding of how things are working matches yours. The demoted join stuff feels like a really strange way to go about this. It makes loads more sense to me to detect these conditions and treat them as simple field comparisons.. ie: don't create the joins in the first place. Regardless, I think this ticket is really important to work on. The .exclude() hack works okay for simple cases pre-1.4, but most Django code I come across doesn't use it.. most people don't know about this bug, or the exclude() workaround... In 1.4 a lot of data access code gets a lot worse/slower. The patch, if severely imperfect, at least provides some evidence that we can do way better. -- Ticket URL: <https://code.djangoproject.com/ticket/10790#comment:32> 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.