Django should do m2m deletes in a single query when possible
|Database layer (models, ORM)
|Ready for checkin
|Patch needs improvement:
As Anssi notes there:
To me it seems there is no reason to do two queries in delete if the following conditions hold: - there are no signals sent for the deleted objects - the delete does not cascade further (actually you don't need to collect even in this case - you can do the cascade query completely in the DB without fetching the IDs first).
I think a good first-cut is auto-created intermediate table and no signals attached for that model.