#33672: bulk_update - duplicate updates as side effect from batch_size
-------------------------------------+-------------------------------------
     Reporter:  jerch                |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  4.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by jerch):

 Would you reconsider the decision, if I'd provide the patch myself? (Would
 need to apply small changes to `bulk_update` anyway, if the fast impl
 should be done...)

 Some reasoning from my side:
 - As software dev I'm inclined to lower mistakes as much as possible.
 Thats even more true for middleware libs like django, where peeps have
 only limited control through API usage. Here the API only offers to play
 with `batch_size`, an argument, thats primary purpose is def. not to
 change update behavior. Thus it is a nasty side effect.
 - The first comment in https://code.djangoproject.com/ticket/29968, that
 brought the performance costs up, admits that this behavior is a mistake.
 And the original implementer answered with "... the behavior could be
 pretty confusing and it's not that expensive to fail loudly. " How that
 led to to just documenting the weird behavior instead of fixing it is a
 mystery to me. He even pointed out, that the performance overhead would be
 small. (Yes it is, already tested that...)
 - It is the 3rd ticket regarding the same underlying issue (my apology for
 not checking beforehand). Maybe thats an indicator, that peeps are worried
 about it?
 - Last but not least - To get the fast update implementation congruent, I
 need reliable update behavior in `bulk_update`. To get congruent with its
 current behavior, I'd need to write a really ugly patch around the batch
 handling, which costs there ~30% performance, just to get in line with a
 partially broken behavior. Isn't it better to fix that broken behavior in
 the first place?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33672#comment:3>
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/010701807b1af9e8-e275ea35-1100-4722-a99d-6a5a8e74a155-000000%40eu-central-1.amazonses.com.

Reply via email to