#27719: Add queryset.alias() to mimic .annotate() for aggregations without 
loading
data
-------------------------------------+-------------------------------------
     Reporter:  Marc Tamlyn          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     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 Christophe Pettus):

 Doing a quick example query: In a table with a relatively large text
 field, but just 2,400 rows, the difference between returning all rows and
 all fields without the ts_vector() call and returning all with it was
 12.7ms vs 24,000ms.

 Doing a full sequential scan (no index) with both calculating the
 to_tsvector() for return ''and'' in query predicate is 27,000ms without
 recalculating the to_tsvector for return, 46,700ms with recalculating it.

 After having created a functional index on the to_tsvector() call, and
 using a relatively common search term, the time to return without
 recalculating the to_tsvector was 1.7ms, vs 21,200ms with recalculating
 the ts_vector.

 So, in any scenario, not having to recalcuate the to_tsvector() is a win.

--
Ticket URL: <https://code.djangoproject.com/ticket/27719#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.97de8536d0c4802fae30915dc5ab5281%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to