#18676: Django should do m2m deletes in a single query when possible -------------------------------------+------------------------------------- Reporter: jdunck | Owner: nobody Type: | Status: new Cleanup/optimization | Version: 1.4 Component: Database layer | Resolution: (models, ORM) | Triage Stage: Accepted Severity: Normal | Needs documentation: 0 Keywords: | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by akaariai):
* has_patch: 0 => 1 Comment: I am going to hijack this ticket for "fast-path" deletion. This is in effect for any model that: - does not have signals attached for pre/post delete (or m2m_changed, if the model happens to be m2m model). - does not lead to further cascades (all cascades except DO_NOTHING prevent the fast path). - do not have parents (this is a special case of reverse-cascade). I have a patch at https://github.com/akaariai/django/tree/fast_delete for this. I think it is ready for 1.5 inclusion. The patch is in two commits: - [https://github.com/akaariai/django/commit/93bf3309ad4b9ee90ea953658ae444a0deea24ec A way to check if there are signals for a model] - [https://github.com/akaariai/django/commit/3c2fce6bdb82d27b153e8061888ec6514795f88c The actual fast path deletion code]. If nothing surprising arises, I will push this into 1.5 before feature freeze. -- Ticket URL: <https://code.djangoproject.com/ticket/18676#comment:2> 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.