#32095: update_or_create should utilize update_fields on update
---------------------------------------------+------------------------
               Reporter:  Florian Apolloner  |          Owner:  nobody
                   Type:  Uncategorized      |         Status:  new
              Component:  Uncategorized      |        Version:  3.1
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 `update_or_create` should update only the fields in `default` on update,
 not all fields. While it is concurrency-safe to update the whole model
 since `update_or_create` fetches the object via `select_for_update` it is
 still unnecessary to re transmit all fields back to the database (probably
 results in more wal/binary logs written etc etc…).

 In the end `update_or_create` (and most likely `get_or_create`) might be
 written in more efficient ways depending on the database backend -- but
 `update_fields` seems to be a rather low-hanging fruit.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32095>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.05c05301f3ded8ec8001c9dad6e85d15%40djangoproject.com.

Reply via email to