#35309: Remove Order by on models when prefetching by id
     Reporter:  Laurent Lyaudet      |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  5.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  prefetch order_by    |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
Comment (by Laurent Lyaudet):

 Again a fast and without thought answer.
 I already know for this solution with Prefetch.
 Continue bashing good ideas because you don't like people giving them.
 I'll applaude at the end.

 There is no way it is useful to keep an order by when you do a query

 SELECT * FROM a WHERE a.id IN (.....100 or more ids here) ORDER BY name;

 then add the result in the cache of B objects.
 What you reject without thought yields a speed-up of 10 to 15 % on very
 big prefetches...
Ticket URL: <https://code.djangoproject.com/ticket/35309#comment:2>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to