In my database I have some tables full of records, when I delete an
object django use the cascade behaviour and this is good, however
seems it make a query for every related object and after this django
seems to issue a delete where id in () for every 100 objects

look at this, Oggetti returns 8244 records:

t=Test.objects.get(pk=10)
Oggetti.objects.filter(test=t).delete()

I interrupted the operation after about 30 minutes and:

len(connection.queries)
4188

now in the database I have 6044 records so only 2200 were deleted and
this make 4188 queries

I think some optimization is needed,

reagards
drakkan





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to