Jupp, that ticket at least shows that I am not the first one to stumble 
onto this :) Baring no objections I will at least try to fix it for the 
"easy" cases; seems like an easy win.

On Wednesday, September 26, 2018 at 9:54:05 PM UTC+2, Tim Graham wrote:
>
> https://code.djangoproject.com/ticket/21171 looks like it should help.
>
> On Wednesday, September 26, 2018 at 2:56:34 PM UTC-4, Florian Apolloner 
> wrote:
>>
>> Hi there,
>>
>> a fun issue came up on IRC today: Even when in autocommit mode, Django 
>> starts a transaction when doing Model.objects.create (
>> https://github.com/django/django/blob/fb2964a4106b1282c4179b6fbbd0374f5be1ccac/django/db/models/base.py#L752).
>>  
>> This makes some sense when there are parents to be saved also, but imo 
>> results in a rather high database roundtrip number for the simple case 
>> where there is a single model without inheritance. Does anyone know why we 
>> do this?
>>
>> I've created a really simple patch 
>> https://github.com/django/django/pull/10448 which already (mostly) 
>> passes the testsuite.
>>
>> Cheers,
>> Florian
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/71d4497a-d749-4899-8f8a-55e9c78284a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to