TRUNCATE has transactional side effects, so I'm +1 on adding
model.objects.truncate(), -1 on optimizing
model.objects.all().delete().

Ian

On 9/19/07, Wensing, Matthew (CNI-Palm Beach) <[EMAIL PROTECTED]> wrote:
>
> Maybe there should be a .truncate()?  Heh.
>
> Matt
>
>
> -----Original Message-----
> From: django-developers@googlegroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Rob Hudson
> Sent: Tuesday, September 18, 2007 10:15 PM
> To: Django developers
> Subject: Is model.objects.all().delete() optimized to use DELETE FROM?
>
>
> Hi Devs,
>
> Is model.objects.all().delete() optimized to use DELETE FROM?  I'm only
> asking because I was trying to clear a table with about 20k records and
> it took minutes rather than seconds.  I'm using MySQL as the backend.
> I'm not very familiar with the database query mechanism and I know it's
> being rewritten.  I couldn't find much in the few places I poked.
>
> Thanks,
> Rob
>
>
>
>
> >
>

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

Reply via email to