#32940: Consider removing unused/unnecessary functionality in tree.Node.add
-------------------------------------+-------------------------------------
     Reporter:  Keryn Knight         |                    Owner:  Keryn
         Type:                       |  Knight
  Cleanup/optimization               |                   Status:  assigned
    Component:  Utilities            |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"ff661dbd506efbdf51cc8da89cb98731c8a62f49" ff661db]:
 {{{
 #!CommitTicketReference repository=""
 revision="ff661dbd506efbdf51cc8da89cb98731c8a62f49"
 Refs #32940 -- Removed unnecessary branch in Node.add().

 The "data in self.children" branch was causing data.__eq__ to be
 called for each entries in "self.children" which resulted in a huge
 slowdown during queryset construction.

 It's purpose was to prevent queries of the form
     Model.objects.filter(foo='bar').filter(foo='bar')
 from resulting in
     WHERE foo='bar' AND foo='bar'
 but it's not covered by the suite and has arguable performance benefits
 since it's not very common and SQL engines are usually very good at
 folding/optimizing these.

 See also #32632 for prior discussion around comparing data to the
 Node's children.

 Co-authored-by: Nick Pope <[email protected]>
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32940#comment:4>
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/067.f0d26e61f56a9478f0a9e0239df3c986%40djangoproject.com.

Reply via email to