django/django — pull request #400 by akaariai (2012-09-27 17:06:53+00:00)
Title: #18676 - allow fast path for object deletion

Summary of the feature: we can skip fetching objects to memory if the following conditions apply:
- there are no further cascades (foreign keys other than DO_NOTHING, no GenericRelations)
- there are no delete signals attached for the model
- there are no parents for the object

If this is the case we can do the deletion directly in the DB which results almost always in faster deletions, especially for large deletion batches. See #18676 for a benchmark.